Skip to content

Commit

Permalink
Autodiscover phpstan.dist.neon as a config file
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rdex authored and ondrejmirtes committed Feb 9, 2022
1 parent 4dd6b69 commit 7206452
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Command/CommandHelper.php
Expand Up @@ -158,7 +158,7 @@ public static function begin(
})($autoloadFile);
}
if ($projectConfigFile === null) {
foreach (['phpstan.neon', 'phpstan.neon.dist'] as $discoverableConfigName) {
foreach (['phpstan.neon', 'phpstan.neon.dist', 'phpstan.dist.neon'] as $discoverableConfigName) {
$discoverableConfigFile = $currentWorkingDirectory . DIRECTORY_SEPARATOR . $discoverableConfigName;
if (is_file($discoverableConfigFile)) {
$projectConfigFile = $discoverableConfigFile;
Expand Down
8 changes: 8 additions & 0 deletions tests/PHPStan/Command/AnalyseCommandTest.php
Expand Up @@ -72,10 +72,18 @@ public static function autoDiscoveryPathsProvider(): array
__DIR__ . '/test-autodiscover-dist',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-dist' . DIRECTORY_SEPARATOR . 'phpstan.neon.dist',
],
[
__DIR__ . '/test-autodiscover-dist-dot-neon',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-dist-dot-neon' . DIRECTORY_SEPARATOR . 'phpstan.dist.neon',
],
[
__DIR__ . '/test-autodiscover-priority',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-priority' . DIRECTORY_SEPARATOR . 'phpstan.neon',
],
[
__DIR__ . '/test-autodiscover-priority-dist-dot-neon',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-priority-dist-dot-neon' . DIRECTORY_SEPARATOR . 'phpstan.neon',
],
];
}

Expand Down
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:

0 comments on commit 7206452

Please sign in to comment.