Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,15 @@ public static function begin(
})($autoloadFile);
}
if ($projectConfigFile === null) {
foreach (['phpstan.neon', 'phpstan.neon.dist', 'phpstan.dist.neon'] as $discoverableConfigName) {
$discoverableConfigNames = [
'.phpstan.neon',
'.phpstan.neon.dist',
'.phpstan.dist.neon',
'phpstan.neon',
'phpstan.neon.dist',
'phpstan.dist.neon',
Comment on lines +183 to +188
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it wanted to load .phpstan.neon.dist rather than phpstan.neon or should it be

				'.phpstan.neon',
				'phpstan.neon',
				'.phpstan.neon.dist',
				'phpstan.neon.dist',
				'.phpstan.dist.neon',
				'phpstan.dist.neon',

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VincentLanglet Please send an update.

];
foreach ($discoverableConfigNames as $discoverableConfigName) {
$discoverableConfigFile = $currentWorkingDirectory . DIRECTORY_SEPARATOR . $discoverableConfigName;
if (is_file($discoverableConfigFile)) {
$projectConfigFile = $discoverableConfigFile;
Expand Down
28 changes: 22 additions & 6 deletions tests/PHPStan/Command/AnalyseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,28 @@ public static function autoDiscoveryPathsProvider(): array
{
return [
[
__DIR__ . '/test-autodiscover',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover' . DIRECTORY_SEPARATOR . 'phpstan.neon',
__DIR__ . '/test-autodiscover-dot',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-dot' . DIRECTORY_SEPARATOR . '.phpstan.neon',
],
[
__DIR__ . '/test-autodiscover-dist',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-dist' . DIRECTORY_SEPARATOR . 'phpstan.neon.dist',
__DIR__ . '/test-autodiscover-dot-dist',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-dot-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-dot-dist-dot-neon',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-dot-dist-dot-neon' . DIRECTORY_SEPARATOR . '.phpstan.dist.neon',
],
[
__DIR__ . '/test-autodiscover-no-dot',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-no-dot' . DIRECTORY_SEPARATOR . 'phpstan.neon',
],
[
__DIR__ . '/test-autodiscover-no-dot-dist',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-no-dot-dist' . DIRECTORY_SEPARATOR . 'phpstan.neon.dist',
],
[
__DIR__ . '/test-autodiscover-no-dot-dist-dot-neon',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-no-dot-dist-dot-neon' . DIRECTORY_SEPARATOR . 'phpstan.dist.neon',
],
[
__DIR__ . '/test-autodiscover-priority',
Expand All @@ -97,6 +109,10 @@ public static function autoDiscoveryPathsProvider(): array
__DIR__ . '/test-autodiscover-priority-dist-dot-neon',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-priority-dist-dot-neon' . DIRECTORY_SEPARATOR . 'phpstan.neon',
],
[
__DIR__ . '/test-autodiscover-priority-dot',
__DIR__ . DIRECTORY_SEPARATOR . 'test-autodiscover-priority-dot' . DIRECTORY_SEPARATOR . '.phpstan.neon',
],
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
4 changes: 4 additions & 0 deletions tests/PHPStan/Command/test-autodiscover-no-dot/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
includes:
- ../../../../conf/bleedingEdge.neon

parameters:
Loading