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
1 change: 1 addition & 0 deletions config/services/services.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- Symplify\PHPStanRules\Naming\ClassToSuffixResolver
- Symplify\PHPStanRules\NodeAnalyzer\AttributeFinder
- Symplify\PHPStanRules\NodeAnalyzer\EnumAnalyzer
- Symplify\PHPStanRules\NodeAnalyzer\LaravelPresenceResolver
- Symplify\PHPStanRules\ParentClassMethodNodeResolver
- Symplify\PHPStanRules\PhpDoc\BarePhpDocParser
- Symplify\PHPStanRules\PhpDoc\PhpDocResolver
Expand Down
2 changes: 0 additions & 2 deletions config/symfony-rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ conditionalTags:
phpstan.rules.rule: %symplify.symfony%

services:
- Symplify\PHPStanRules\NodeAnalyzer\LaravelPresenceResolver

-
class: Symplify\PHPStanRules\Composer\ComposerRequireResolver
arguments:
Expand Down
16 changes: 16 additions & 0 deletions tests/NodeAnalyzer/LaravelPresenceResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@ public function testNonLaravelProject(): void
// Laravel is not installed here, so it must not be detected
$this->assertFalse($laravelPresenceResolver->isLaravelProject());
}

public function testRegisteredInSharedServices(): void
{
// rules picked one by one only include services.neon, so the resolver must be registered there
$laravelPresenceResolver = self::getContainer()->getByType(LaravelPresenceResolver::class);

$this->assertInstanceOf(LaravelPresenceResolver::class, $laravelPresenceResolver);
}

/**
* @return string[]
*/
public static function getAdditionalConfigFiles(): array
{
return [__DIR__ . '/../config/included_services.neon'];
}
}
Loading