Skip to content

Commit

Permalink
Do not add includes if phpstan/extension-installer exists
Browse files Browse the repository at this point in the history
Fixes #251
  • Loading branch information
mglaman committed Nov 15, 2021
1 parent d2e57a7 commit b08ba99
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Command/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('<comment>Assumed running as local dependency</comment>', OutputInterface::VERBOSITY_DEBUG);
$phpstanBin = \realpath(__DIR__ . '/../../vendor/phpstan/phpstan/phpstan.phar');
$configuration_data['parameters']['bootstrapFiles'] = [\realpath(__DIR__ . '/../../error-bootstrap.php')];
$configuration_data['includes'] = [
\realpath(__DIR__ . '/../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'),
\realpath(__DIR__ . '/../../vendor/mglaman/phpstan-drupal/extension.neon'),
];
if (!class_exists('PHPStan\ExtensionInstaller\GeneratedConfig')) {
$configuration_data['includes'] = [
\realpath(__DIR__ . '/../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'),
\realpath(__DIR__ . '/../../vendor/mglaman/phpstan-drupal/extension.neon'),
];
}

} elseif (file_exists(__DIR__ . '/../../../../autoload.php')) {
// Running as a global dependency.
$output->writeln('<comment>Assumed running as global dependency</comment>', OutputInterface::VERBOSITY_DEBUG);
Expand Down

0 comments on commit b08ba99

Please sign in to comment.