Skip to content

Commit d17e187

Browse files
committed
cs
1 parent cc7df54 commit d17e187

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"stubs"
4141
],
4242
"files": [
43-
"vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php"
43+
"vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php",
44+
"tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/Fixture/SomePhpFeatureRector.php"
4445
]
4546
},
4647
"config": {

phpstan.neon

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ 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

@@ -47,6 +44,10 @@ parameters:
4744
# used in tests
4845
- '#Public constant "Symplify\\PHPStanRules\\(.*?)Rule\:\:ERROR_MESSAGE" is never used#'
4946

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

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)