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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"phpstan/phpstan-nette": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"rector/rector": "^2.3",
"rector/rector": "^2.5.9",
"slevomat/coding-standard": "^8.15.0",
"squizlabs/php_codesniffer": "^3.9.2",
"symplify/easy-coding-standard": "^12.1.14",
Expand Down
4 changes: 0 additions & 4 deletions default-phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ includes:
services:
# Handy services from Rector package
- Rector\NodeNameResolver\NodeNameResolver
- Rector\Skipper\Matcher\FileInfoMatcher
- Rector\CodingStyle\Naming\ClassNaming
- Rector\NodeAnalyzer\CallAnalyzer
- Rector\Skipper\FileSystem\FnMatchPathNormalizer
- Rector\Skipper\Fnmatcher
- Rector\Skipper\RealpathMatcher

parameters:
level: max
4 changes: 0 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ includes:
services:
# Handy services from Rector package
- Rector\NodeNameResolver\NodeNameResolver
- Rector\Skipper\Matcher\FileInfoMatcher
- Rector\CodingStyle\Naming\ClassNaming
- Rector\NodeAnalyzer\CallAnalyzer
- Rector\Skipper\FileSystem\FnMatchPathNormalizer
- Rector\Skipper\Fnmatcher
- Rector\Skipper\RealpathMatcher

-
class: BrandEmbassyCodingStandard\PhpStan\Rules\Mockery\TestsExtendMockeryTestCaseRule\TestsExtendMockeryTestCaseRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

if ($this->fileInfoMatcher->doesFileInfoMatchPatterns(
if ($this->fileInfoMatcher->matchPattern(
$constantClassReflection->getFileName() ?? '',
$this->allowedPatterns,
)) {
) !== null) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
use BrandEmbassyCodingStandard\PhpStan\Rules\DisallowConstantsInTestsRule\__fixtures__\AllowedConstant;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use Rector\Skipper\FileSystem\FnMatchPathNormalizer;
use Rector\Skipper\Fnmatcher;
use Rector\Skipper\Matcher\FileInfoMatcher;
use Rector\Skipper\RealpathMatcher;

/**
* @extends RuleTestCase<DisallowConstantsInTestsRule>
Expand All @@ -19,7 +16,7 @@ protected function getRule(): Rule
{
return new DisallowConstantsInTestsRule(
$this->createReflectionProvider(),
new FileInfoMatcher(new FnMatchPathNormalizer(), new Fnmatcher(), new RealpathMatcher()),
new FileInfoMatcher(),
['*AllowedPattern.php'],
[AllowedConstant::class],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ public function refactor(Node $node)
return null;
}

if ($this->fileInfoMatcher->doesFileInfoMatchPatterns(
if ($this->fileInfoMatcher->matchPattern(
$constantClassReflection->getFileName() ?? '',
$this->allowedPatterns,
)) {
) !== null) {
return null;
}

Expand Down
Loading