mirror of
https://github.com/danog/psalm.git
synced 2025-01-23 06:11:25 +01:00
Use PHPStorm output format by default on JetBrains terminals
This commit is contained in:
parent
bebce06014
commit
bf1a7365d2
@ -403,7 +403,20 @@ final class Psalm
|
||||
{
|
||||
return isset($options['output-format']) && is_string($options['output-format'])
|
||||
? $options['output-format']
|
||||
: Report::TYPE_CONSOLE;
|
||||
: self::findDefaultOutputFormat();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Report::TYPE_*
|
||||
*/
|
||||
private static function findDefaultOutputFormat(): string
|
||||
{
|
||||
$emulator = getenv('TERMINAL_EMULATOR');
|
||||
if (is_string($emulator) && substr($emulator, 0, 9) === 'JetBrains') {
|
||||
return Report::TYPE_PHP_STORM;
|
||||
}
|
||||
|
||||
return Report::TYPE_CONSOLE;
|
||||
}
|
||||
|
||||
private static function initShowInfo(array $options): bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user