Skip to content

Commit 26e01fd

Browse files
committed
cs
1 parent cc7df54 commit 26e01fd

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

phpstan.neon

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ parameters:
3333
- '#Method Symplify\\PHPStanRules\\(.*?)\:\:getRule\(\) return type with generic interface PHPStan\\Rules\\Rule does not specify its types\: TNodeType#'
3434
- '#Parameter \#2 \$expectedErrors of method PHPStan\\Testing\\RuleTestCase<PHPStan\\Rules\\Rule>\:\:analyse\(\) expects list<array\{0\: string, 1\: int, 2\?\: string\|null\}>, (.*?) given#'
3535

36-
# part of public contract
37-
- '#Method Symplify\\PHPStanRules\\Tests\\Rules\\(.*?)\\(.*?)Test\:\:testRule\(\) has parameter \$(expectedError(.*?)|expectedErrors) with no value type specified in iterable type array#'
38-
3936
# useful to have IDE know the types
4037
- identifier: phpstanApi.instanceofType
4138

39+
- '#Class Rector\\Php80\\Rector\\Class_\\SomePhpFeatureRector not found#'
40+
4241
# fast effective check
4342
-
4443
message: '#Function is_a\(\) is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine#'
@@ -47,6 +46,10 @@ parameters:
4746
# used in tests
4847
- '#Public constant "Symplify\\PHPStanRules\\(.*?)Rule\:\:ERROR_MESSAGE" is never used#'
4948

49+
-
50+
message: '#Generator expects value type array<string, mixed>, list<bool\|float\|int\|list<string>\|PHPStan\\TrinaryLogic\|string\|null> given#'
51+
path: tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php
52+
5053
- '#Although PHPStan\\Node\\InClassNode is covered by backward compatibility promise, this instanceof assumption might break because (.*?) not guaranteed to always stay the same#'
5154
- '#PHPStan\\DependencyInjection\\NeonAdapter#'
5255

src/Rules/NoGlobalConstRule.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use PhpParser\Node;
88
use PhpParser\Node\Stmt\Const_;
99
use PHPStan\Analyser\Scope;
10+
use PHPStan\Rules\IdentifierRuleError;
1011
use PHPStan\Rules\Rule;
1112
use PHPStan\Rules\RuleErrorBuilder;
1213
use Symplify\PHPStanRules\Enum\RuleIdentifier;
@@ -29,6 +30,7 @@ public function getNodeType(): string
2930

3031
/**
3132
* @param Const_ $node
33+
* @return IdentifierRuleError[]
3234
*/
3335
public function processNode(Node $node, Scope $scope): array
3436
{

src/Rules/Symfony/RequiredOnlyInAbstractRule.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use PHPStan\Reflection\ClassReflection;
1313
use PHPStan\Rules\Rule;
1414
use PHPStan\Rules\RuleErrorBuilder;
15+
use Symplify\PHPStanRules\Enum\DoctrineClass;
1516
use Symplify\PHPStanRules\Enum\RuleIdentifier\SymfonyRuleIdentifier;
1617
use Symplify\PHPStanRules\NodeAnalyzer\SymfonyRequiredMethodAnalyzer;
1718

@@ -34,7 +35,7 @@ final class RequiredOnlyInAbstractRule implements Rule
3435
* @var string[]
3536
*/
3637
private const SKIPPED_PARENT_TYPES = [
37-
'Doctrine\ODM\MongoDB\Repository\DocumentRepository',
38+
DoctrineClass::DOCUMENT_REPOSITORY,
3839
];
3940

4041
public function getNodeType(): string

tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function testAsserts(string $assertType, string $file, mixed ...$args): v
2020
}
2121

2222
/**
23-
* @return Iterator<array<string, array<array<mixed>, mixed>>>
23+
* @return Iterator<array<string, mixed>>
2424
*/
2525
public static function dataAsserts(): Iterator
2626
{

tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
namespace Symplify\PHPStanRules\Tests\Rules\Rector\PhpUpgradeImplementsMinPhpVersionInterfaceRule;
66

7-
use Rector\Php80\Rector\Class_\SomePhpFeatureRector;
87
use Iterator;
98
use PHPStan\Rules\Rule;
109
use PHPStan\Testing\RuleTestCase;
1110
use PHPUnit\Framework\Attributes\DataProvider;
11+
use Rector\Php80\Rector\Class_\SomePhpFeatureRector;
1212
use Symplify\PHPStanRules\Rules\Rector\PhpUpgradeImplementsMinPhpVersionInterfaceRule;
1313

1414
final class PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest extends RuleTestCase

0 commit comments

Comments
 (0)