Skip to content

Commit b08ba99

Browse files
committed
Do not add includes if phpstan/extension-installer exists
Fixes #251
1 parent d2e57a7 commit b08ba99

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Command/CheckCommand.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
190190
$output->writeln('<comment>Assumed running as local dependency</comment>', OutputInterface::VERBOSITY_DEBUG);
191191
$phpstanBin = \realpath(__DIR__ . '/../../vendor/phpstan/phpstan/phpstan.phar');
192192
$configuration_data['parameters']['bootstrapFiles'] = [\realpath(__DIR__ . '/../../error-bootstrap.php')];
193-
$configuration_data['includes'] = [
194-
\realpath(__DIR__ . '/../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'),
195-
\realpath(__DIR__ . '/../../vendor/mglaman/phpstan-drupal/extension.neon'),
196-
];
193+
if (!class_exists('PHPStan\ExtensionInstaller\GeneratedConfig')) {
194+
$configuration_data['includes'] = [
195+
\realpath(__DIR__ . '/../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'),
196+
\realpath(__DIR__ . '/../../vendor/mglaman/phpstan-drupal/extension.neon'),
197+
];
198+
}
199+
197200
} elseif (file_exists(__DIR__ . '/../../../../autoload.php')) {
198201
// Running as a global dependency.
199202
$output->writeln('<comment>Assumed running as global dependency</comment>', OutputInterface::VERBOSITY_DEBUG);

0 commit comments

Comments
 (0)