diff --git a/composer.json b/composer.json index 148f0bae..5887ba97 100644 --- a/composer.json +++ b/composer.json @@ -7,20 +7,20 @@ "php": ">=8.2", "webmozart/assert": "^1.12 || ^2.0", "phpstan/phpstan": "^2.1.30", - "nette/utils": "^4.0", + "nette/utils": "^4.1", "phpstan/phpdoc-parser": "^2.3" }, "require-dev": { - "nikic/php-parser": "^5.6", + "nikic/php-parser": "^5.7", "phpunit/phpunit": "^11.5", "symfony/framework-bundle": "6.1.*", "phpecs/phpecs": "^2.2", "tomasvotruba/class-leak": "^2.1", - "rector/rector": "^2.2.11", + "rector/rector": "^2.3", "phpstan/extension-installer": "^1.4", "symplify/phpstan-extensions": "^12.0", "tomasvotruba/unused-public": "^2.1", - "tomasvotruba/type-coverage": "^2.0", + "tomasvotruba/type-coverage": "^2.1", "shipmonk/composer-dependency-analyser": "^1.8", "rector/jack": "^0.4.0" }, @@ -40,7 +40,8 @@ "stubs" ], "files": [ - "vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php" + "vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php", + "tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/Fixture/SomePhpFeatureRector.php" ] }, "config": { diff --git a/phpstan.neon b/phpstan.neon index 3d8609f8..564c4d1d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -33,9 +33,6 @@ parameters: - '#Method Symplify\\PHPStanRules\\(.*?)\:\:getRule\(\) return type with generic interface PHPStan\\Rules\\Rule does not specify its types\: TNodeType#' - '#Parameter \#2 \$expectedErrors of method PHPStan\\Testing\\RuleTestCase\:\:analyse\(\) expects list, (.*?) given#' - # part of public contract - - '#Method Symplify\\PHPStanRules\\Tests\\Rules\\(.*?)\\(.*?)Test\:\:testRule\(\) has parameter \$(expectedError(.*?)|expectedErrors) with no value type specified in iterable type array#' - # useful to have IDE know the types - identifier: phpstanApi.instanceofType @@ -47,6 +44,10 @@ parameters: # used in tests - '#Public constant "Symplify\\PHPStanRules\\(.*?)Rule\:\:ERROR_MESSAGE" is never used#' + - + message: '#Generator expects value type array, list\|PHPStan\\TrinaryLogic\|string\|null> given#' + path: tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php + - '#Although PHPStan\\Node\\InClassNode is covered by backward compatibility promise, this instanceof assumption might break because (.*?) not guaranteed to always stay the same#' - '#PHPStan\\DependencyInjection\\NeonAdapter#' diff --git a/rector.php b/rector.php index 66a5f633..13e4ac7a 100644 --- a/rector.php +++ b/rector.php @@ -7,7 +7,7 @@ return RectorConfig::configure() ->withPhpSets() - ->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, typeDeclarations: true, privatization: true, naming: true, earlyReturn: true, phpunitCodeQuality: true) + ->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, typeDeclarations: true, typeDeclarationDocblocks: true, privatization: true, naming: true, earlyReturn: true, phpunitCodeQuality: true) ->withPaths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/tests']) ->withRootFiles() ->withImportNames() @@ -15,8 +15,8 @@ '*/Source/*', '*/Fixture/*', StringClassNameToClassConstantRector::class => [ - __DIR__ . '/src/Symfony/NodeAnalyzer/SymfonyControllerAnalyzer.php', + __DIR__ . '/src/Enum', + __DIR__ . '/src/Testing/PHPUnitTestAnalyser.php', __DIR__ . '/tests/Naming/ClassToSuffixResolverTest.php', - __DIR__ . '/tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest.php', ], ]); diff --git a/src/Rules/NoGlobalConstRule.php b/src/Rules/NoGlobalConstRule.php index d3260851..ee211d04 100644 --- a/src/Rules/NoGlobalConstRule.php +++ b/src/Rules/NoGlobalConstRule.php @@ -7,6 +7,7 @@ use PhpParser\Node; use PhpParser\Node\Stmt\Const_; use PHPStan\Analyser\Scope; +use PHPStan\Rules\IdentifierRuleError; use PHPStan\Rules\Rule; use PHPStan\Rules\RuleErrorBuilder; use Symplify\PHPStanRules\Enum\RuleIdentifier; @@ -29,6 +30,7 @@ public function getNodeType(): string /** * @param Const_ $node + * @return IdentifierRuleError[] */ public function processNode(Node $node, Scope $scope): array { diff --git a/src/Rules/Symfony/RequiredOnlyInAbstractRule.php b/src/Rules/Symfony/RequiredOnlyInAbstractRule.php index 7acac4eb..8375acc6 100644 --- a/src/Rules/Symfony/RequiredOnlyInAbstractRule.php +++ b/src/Rules/Symfony/RequiredOnlyInAbstractRule.php @@ -12,6 +12,7 @@ use PHPStan\Reflection\ClassReflection; use PHPStan\Rules\Rule; use PHPStan\Rules\RuleErrorBuilder; +use Symplify\PHPStanRules\Enum\DoctrineClass; use Symplify\PHPStanRules\Enum\RuleIdentifier\SymfonyRuleIdentifier; use Symplify\PHPStanRules\NodeAnalyzer\SymfonyRequiredMethodAnalyzer; @@ -34,7 +35,7 @@ final class RequiredOnlyInAbstractRule implements Rule * @var string[] */ private const SKIPPED_PARENT_TYPES = [ - 'Doctrine\ODM\MongoDB\Repository\DocumentRepository', + DoctrineClass::DOCUMENT_REPOSITORY, ]; public function getNodeType(): string diff --git a/src/Symfony/NodeAnalyzer/SymfonyControllerAnalyzer.php b/src/Symfony/NodeAnalyzer/SymfonyControllerAnalyzer.php index dce89502..6bcdd101 100644 --- a/src/Symfony/NodeAnalyzer/SymfonyControllerAnalyzer.php +++ b/src/Symfony/NodeAnalyzer/SymfonyControllerAnalyzer.php @@ -59,7 +59,7 @@ public static function hasRouteAnnotationOrAttribute(ClassLike | ClassMethod $no return false; } - if (str_contains($docComment->getText(), 'Symfony\Component\Routing\Annotation\Route')) { + if (str_contains($docComment->getText(), SymfonyClass::ROUTE_ANNOTATION)) { return true; } diff --git a/tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php b/tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php index 66d55b9a..8f9c6c8c 100644 --- a/tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php +++ b/tests/ReturnTypeExtension/NodeGetAttributeTypeExtension/NodeGetAttributeTypeExtensionTest.php @@ -19,6 +19,9 @@ public function testAsserts(string $assertType, string $file, mixed ...$args): v $this->assertFileAsserts($assertType, $file, ...$args); } + /** + * @return Iterator> + */ public static function dataAsserts(): Iterator { yield from self::gatherAssertTypes(__DIR__ . '/data/get_parent_node.php.inc'); diff --git a/tests/Rules/CheckRequiredInterfaceInContractNamespaceRule/CheckRequiredInterfaceInContractNamespaceRuleTest.php b/tests/Rules/CheckRequiredInterfaceInContractNamespaceRule/CheckRequiredInterfaceInContractNamespaceRuleTest.php index 11df6dc7..666a76a8 100644 --- a/tests/Rules/CheckRequiredInterfaceInContractNamespaceRule/CheckRequiredInterfaceInContractNamespaceRuleTest.php +++ b/tests/Rules/CheckRequiredInterfaceInContractNamespaceRule/CheckRequiredInterfaceInContractNamespaceRuleTest.php @@ -12,12 +12,18 @@ final class CheckRequiredInterfaceInContractNamespaceRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/Contract/SkipInterfaceInContract.php', []]; diff --git a/tests/Rules/ClassNameRespectsParentSuffixRule/ClassNameRespectsParentSuffixRuleTest.php b/tests/Rules/ClassNameRespectsParentSuffixRule/ClassNameRespectsParentSuffixRuleTest.php index bef562bd..7b6952d1 100644 --- a/tests/Rules/ClassNameRespectsParentSuffixRule/ClassNameRespectsParentSuffixRuleTest.php +++ b/tests/Rules/ClassNameRespectsParentSuffixRule/ClassNameRespectsParentSuffixRuleTest.php @@ -13,7 +13,7 @@ final class ClassNameRespectsParentSuffixRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipCommand.php', []]; diff --git a/tests/Rules/Complexity/ForbiddenArrayMethodCallRule/ForbiddenArrayMethodCallRuleTest.php b/tests/Rules/Complexity/ForbiddenArrayMethodCallRule/ForbiddenArrayMethodCallRuleTest.php index 096de868..bccc909f 100644 --- a/tests/Rules/Complexity/ForbiddenArrayMethodCallRule/ForbiddenArrayMethodCallRuleTest.php +++ b/tests/Rules/Complexity/ForbiddenArrayMethodCallRule/ForbiddenArrayMethodCallRuleTest.php @@ -13,7 +13,7 @@ final class ForbiddenArrayMethodCallRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipNormalArray.php', []]; diff --git a/tests/Rules/Complexity/NoJustPropertyAssignRule/NoJustPropertyAssignRuleTest.php b/tests/Rules/Complexity/NoJustPropertyAssignRule/NoJustPropertyAssignRuleTest.php index 0b97a516..de82be4a 100644 --- a/tests/Rules/Complexity/NoJustPropertyAssignRule/NoJustPropertyAssignRuleTest.php +++ b/tests/Rules/Complexity/NoJustPropertyAssignRule/NoJustPropertyAssignRuleTest.php @@ -13,7 +13,7 @@ final class NoJustPropertyAssignRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorsWithLines + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorsWithLines): void $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/ServiceAssign.php', [ diff --git a/tests/Rules/Convention/ParamNameToTypeConventionRule/ParamNameToTypeConventionRuleTest.php b/tests/Rules/Convention/ParamNameToTypeConventionRule/ParamNameToTypeConventionRuleTest.php index 80e06cac..c9c2f00d 100644 --- a/tests/Rules/Convention/ParamNameToTypeConventionRule/ParamNameToTypeConventionRuleTest.php +++ b/tests/Rules/Convention/ParamNameToTypeConventionRule/ParamNameToTypeConventionRuleTest.php @@ -13,7 +13,7 @@ final class ParamNameToTypeConventionRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorsWithLines + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorsWithLines): void $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(ParamNameToTypeConventionRule::ERROR_MESSAGE, 'userId', 'int'); diff --git a/tests/Rules/Doctrine/NoDoctrineListenerWithoutContractRule/NoDoctrineListenerWithoutContractRuleTest.php b/tests/Rules/Doctrine/NoDoctrineListenerWithoutContractRule/NoDoctrineListenerWithoutContractRuleTest.php index 3c4d1ea3..2aa6d52c 100644 --- a/tests/Rules/Doctrine/NoDoctrineListenerWithoutContractRule/NoDoctrineListenerWithoutContractRuleTest.php +++ b/tests/Rules/Doctrine/NoDoctrineListenerWithoutContractRule/NoDoctrineListenerWithoutContractRuleTest.php @@ -14,6 +14,7 @@ final class NoDoctrineListenerWithoutContractRuleTest extends RuleTestCase { /** * @param string[] $filePaths + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void @@ -21,6 +22,9 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void $this->analyse($filePaths, $expectedErrorsWithLines); } + /** + * @return Iterator>, mixed>> + */ public static function provideData(): Iterator { yield [[__DIR__ . '/Fixture/SkipContractAwareListener.php'], []]; diff --git a/tests/Rules/Doctrine/NoGetRepositoryOnServiceRepositoryEntityRule/NoGetRepositoryOnServiceRepositoryEntityRuleTest.php b/tests/Rules/Doctrine/NoGetRepositoryOnServiceRepositoryEntityRule/NoGetRepositoryOnServiceRepositoryEntityRuleTest.php index cf56700d..b36ab934 100644 --- a/tests/Rules/Doctrine/NoGetRepositoryOnServiceRepositoryEntityRule/NoGetRepositoryOnServiceRepositoryEntityRuleTest.php +++ b/tests/Rules/Doctrine/NoGetRepositoryOnServiceRepositoryEntityRule/NoGetRepositoryOnServiceRepositoryEntityRuleTest.php @@ -15,7 +15,7 @@ final class NoGetRepositoryOnServiceRepositoryEntityRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -23,6 +23,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(NoGetRepositoryOnServiceRepositoryEntityRule::ERROR_MESSAGE, 'SomeEntity', SomeServiceRepository::class); diff --git a/tests/Rules/Doctrine/NoGetRepositoryOutsideServiceRule/NoGetRepositoryOutsideServiceRuleTest.php b/tests/Rules/Doctrine/NoGetRepositoryOutsideServiceRule/NoGetRepositoryOutsideServiceRuleTest.php index ef58b63d..53d22f07 100644 --- a/tests/Rules/Doctrine/NoGetRepositoryOutsideServiceRule/NoGetRepositoryOutsideServiceRuleTest.php +++ b/tests/Rules/Doctrine/NoGetRepositoryOutsideServiceRule/NoGetRepositoryOutsideServiceRuleTest.php @@ -13,7 +13,7 @@ final class NoGetRepositoryOutsideServiceRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/NonRepositoryUsingEntityManager.php', [[ diff --git a/tests/Rules/Doctrine/NoParentRepositoryRule/NoParentRepositoryRuleTest.php b/tests/Rules/Doctrine/NoParentRepositoryRule/NoParentRepositoryRuleTest.php index a35ca252..3c414ac4 100644 --- a/tests/Rules/Doctrine/NoParentRepositoryRule/NoParentRepositoryRuleTest.php +++ b/tests/Rules/Doctrine/NoParentRepositoryRule/NoParentRepositoryRuleTest.php @@ -12,12 +12,18 @@ final class NoParentRepositoryRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorMessagesWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void { $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeRepository.php', [[NoParentRepositoryRule::ERROR_MESSAGE, 9]]]; diff --git a/tests/Rules/Doctrine/NoRepositoryCallInDataFixtureRule/NoRepositoryCallInDataFixtureRuleTest.php b/tests/Rules/Doctrine/NoRepositoryCallInDataFixtureRule/NoRepositoryCallInDataFixtureRuleTest.php index 07b4a66c..1cc15c82 100644 --- a/tests/Rules/Doctrine/NoRepositoryCallInDataFixtureRule/NoRepositoryCallInDataFixtureRuleTest.php +++ b/tests/Rules/Doctrine/NoRepositoryCallInDataFixtureRule/NoRepositoryCallInDataFixtureRuleTest.php @@ -12,12 +12,18 @@ final class NoRepositoryCallInDataFixtureRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [ diff --git a/tests/Rules/Doctrine/RequireQueryBuilderOnRepositoryRule/RequireQueryBuilderOnRepositoryRuleTest.php b/tests/Rules/Doctrine/RequireQueryBuilderOnRepositoryRule/RequireQueryBuilderOnRepositoryRuleTest.php index 72d0e8de..a5400748 100644 --- a/tests/Rules/Doctrine/RequireQueryBuilderOnRepositoryRule/RequireQueryBuilderOnRepositoryRuleTest.php +++ b/tests/Rules/Doctrine/RequireQueryBuilderOnRepositoryRule/RequireQueryBuilderOnRepositoryRuleTest.php @@ -12,12 +12,18 @@ final class RequireQueryBuilderOnRepositoryRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipCreateQueryBuilderOnRepository.php', []]; diff --git a/tests/Rules/Doctrine/RequireServiceRepositoryParentRule/RequireServiceRepositoryParentRuleTest.php b/tests/Rules/Doctrine/RequireServiceRepositoryParentRule/RequireServiceRepositoryParentRuleTest.php index 3ee2baf5..91d3e458 100644 --- a/tests/Rules/Doctrine/RequireServiceRepositoryParentRule/RequireServiceRepositoryParentRuleTest.php +++ b/tests/Rules/Doctrine/RequireServiceRepositoryParentRule/RequireServiceRepositoryParentRuleTest.php @@ -13,12 +13,18 @@ final class RequireServiceRepositoryParentRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(RequireServiceRepositoryParentRule::ERROR_MESSAGE, DoctrineClass::ODM_SERVICE_REPOSITORY, DoctrineClass::ORM_SERVICE_REPOSITORY, DoctrineClass::ODM_SERVICE_REPOSITORY_INTERFACE); diff --git a/tests/Rules/Domain/RequireAttributeNamespaceRule/RequireAttributeNamespaceRuleTest.php b/tests/Rules/Domain/RequireAttributeNamespaceRule/RequireAttributeNamespaceRuleTest.php index 34f34c28..fbd9d0cc 100644 --- a/tests/Rules/Domain/RequireAttributeNamespaceRule/RequireAttributeNamespaceRuleTest.php +++ b/tests/Rules/Domain/RequireAttributeNamespaceRule/RequireAttributeNamespaceRuleTest.php @@ -13,7 +13,7 @@ final class RequireAttributeNamespaceRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/MisslocatedAttribute.php', [[RequireAttributeNamespaceRule::ERROR_MESSAGE, 7]]]; diff --git a/tests/Rules/Domain/RequireExceptionNamespaceRule/RequireExceptionNamespaceRuleTest.php b/tests/Rules/Domain/RequireExceptionNamespaceRule/RequireExceptionNamespaceRuleTest.php index 5681b3df..8fc3efa3 100644 --- a/tests/Rules/Domain/RequireExceptionNamespaceRule/RequireExceptionNamespaceRuleTest.php +++ b/tests/Rules/Domain/RequireExceptionNamespaceRule/RequireExceptionNamespaceRuleTest.php @@ -13,7 +13,7 @@ final class RequireExceptionNamespaceRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/MisslocatedException.php', [[RequireExceptionNamespaceRule::ERROR_MESSAGE, 9]]]; diff --git a/tests/Rules/Enum/RequireUniqueEnumConstantRule/RequireUniqueEnumConstantRuleTest.php b/tests/Rules/Enum/RequireUniqueEnumConstantRule/RequireUniqueEnumConstantRuleTest.php index bc5120d9..b9adbef3 100644 --- a/tests/Rules/Enum/RequireUniqueEnumConstantRule/RequireUniqueEnumConstantRuleTest.php +++ b/tests/Rules/Enum/RequireUniqueEnumConstantRule/RequireUniqueEnumConstantRuleTest.php @@ -13,7 +13,7 @@ final class RequireUniqueEnumConstantRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $expectedErrorMessage = sprintf(RequireUniqueEnumConstantRule::ERROR_MESSAGE, 'yes'); diff --git a/tests/Rules/Explicit/ExplicitClassPrefixSuffixRule/ExplicitClassPrefixSuffixRuleTest.php b/tests/Rules/Explicit/ExplicitClassPrefixSuffixRule/ExplicitClassPrefixSuffixRuleTest.php index c4c6752b..c1b5b065 100644 --- a/tests/Rules/Explicit/ExplicitClassPrefixSuffixRule/ExplicitClassPrefixSuffixRuleTest.php +++ b/tests/Rules/Explicit/ExplicitClassPrefixSuffixRule/ExplicitClassPrefixSuffixRuleTest.php @@ -12,12 +12,18 @@ final class ExplicitClassPrefixSuffixRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/CorrectInterface.php', []]; diff --git a/tests/Rules/Explicit/NoMissingVariableDimFetchRule/NoMissingVariableDimFetchRuleTest.php b/tests/Rules/Explicit/NoMissingVariableDimFetchRule/NoMissingVariableDimFetchRuleTest.php index 9bd4bcf8..be52f5c9 100644 --- a/tests/Rules/Explicit/NoMissingVariableDimFetchRule/NoMissingVariableDimFetchRuleTest.php +++ b/tests/Rules/Explicit/NoMissingVariableDimFetchRule/NoMissingVariableDimFetchRuleTest.php @@ -12,12 +12,18 @@ final class NoMissingVariableDimFetchRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipDefinedVariable.php', []]; diff --git a/tests/Rules/Explicit/NoProtectedClassStmtRule/NoProtectedClassStmtRuleTest.php b/tests/Rules/Explicit/NoProtectedClassStmtRule/NoProtectedClassStmtRuleTest.php index f4a5f6bc..f525f31a 100644 --- a/tests/Rules/Explicit/NoProtectedClassStmtRule/NoProtectedClassStmtRuleTest.php +++ b/tests/Rules/Explicit/NoProtectedClassStmtRule/NoProtectedClassStmtRuleTest.php @@ -12,12 +12,18 @@ final class NoProtectedClassStmtRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/ClassWithProtected.php', [ diff --git a/tests/Rules/ForbiddenExtendOfNonAbstractClassRule/ForbiddenExtendOfNonAbstractClassRuleTest.php b/tests/Rules/ForbiddenExtendOfNonAbstractClassRule/ForbiddenExtendOfNonAbstractClassRuleTest.php index 5566817a..200c702e 100644 --- a/tests/Rules/ForbiddenExtendOfNonAbstractClassRule/ForbiddenExtendOfNonAbstractClassRuleTest.php +++ b/tests/Rules/ForbiddenExtendOfNonAbstractClassRule/ForbiddenExtendOfNonAbstractClassRuleTest.php @@ -13,7 +13,7 @@ final class ForbiddenExtendOfNonAbstractClassRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [ diff --git a/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleTest.php b/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleTest.php index 7528d3b8..58f44d46 100644 --- a/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleTest.php +++ b/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleTest.php @@ -13,7 +13,7 @@ final class ForbiddenFuncCallRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(ForbiddenFuncCallRule::ERROR_MESSAGE, 'dump'); diff --git a/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleWithDeprecationsTest.php b/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleWithDeprecationsTest.php index 649ce5c3..4f60c537 100644 --- a/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleWithDeprecationsTest.php +++ b/tests/Rules/ForbiddenFuncCallRule/ForbiddenFuncCallRuleWithDeprecationsTest.php @@ -13,7 +13,7 @@ final class ForbiddenFuncCallRuleWithDeprecationsTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { // custom messages are defined in the config file diff --git a/tests/Rules/ForbiddenMultipleClassLikeInOneFileRule/ForbiddenMultipleClassLikeInOneFileRuleTest.php b/tests/Rules/ForbiddenMultipleClassLikeInOneFileRule/ForbiddenMultipleClassLikeInOneFileRuleTest.php index 80b4d481..c561dcc7 100644 --- a/tests/Rules/ForbiddenMultipleClassLikeInOneFileRule/ForbiddenMultipleClassLikeInOneFileRuleTest.php +++ b/tests/Rules/ForbiddenMultipleClassLikeInOneFileRule/ForbiddenMultipleClassLikeInOneFileRuleTest.php @@ -13,7 +13,7 @@ final class ForbiddenMultipleClassLikeInOneFileRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipOneInterface.php', []]; diff --git a/tests/Rules/ForbiddenNodeRule/ForbiddenNodeRuleTest.php b/tests/Rules/ForbiddenNodeRule/ForbiddenNodeRuleTest.php index e67d3db6..daf23219 100644 --- a/tests/Rules/ForbiddenNodeRule/ForbiddenNodeRuleTest.php +++ b/tests/Rules/ForbiddenNodeRule/ForbiddenNodeRuleTest.php @@ -13,7 +13,7 @@ final class ForbiddenNodeRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { $errorMessage = sprintf(ForbiddenNodeRule::ERROR_MESSAGE, 'empty($value)'); diff --git a/tests/Rules/ForbiddenStaticClassConstFetchRule/ForbiddenStaticClassConstFetchRuleTest.php b/tests/Rules/ForbiddenStaticClassConstFetchRule/ForbiddenStaticClassConstFetchRuleTest.php index 14896d0b..13239d51 100644 --- a/tests/Rules/ForbiddenStaticClassConstFetchRule/ForbiddenStaticClassConstFetchRuleTest.php +++ b/tests/Rules/ForbiddenStaticClassConstFetchRule/ForbiddenStaticClassConstFetchRuleTest.php @@ -13,7 +13,7 @@ final class ForbiddenStaticClassConstFetchRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { yield [ diff --git a/tests/Rules/NoArrayMapWithArrayCallableRule/NoArrayMapWithArrayCallableRuleTest.php b/tests/Rules/NoArrayMapWithArrayCallableRule/NoArrayMapWithArrayCallableRuleTest.php index 888a8af2..4b0ed5fe 100644 --- a/tests/Rules/NoArrayMapWithArrayCallableRule/NoArrayMapWithArrayCallableRuleTest.php +++ b/tests/Rules/NoArrayMapWithArrayCallableRule/NoArrayMapWithArrayCallableRuleTest.php @@ -13,7 +13,7 @@ final class NoArrayMapWithArrayCallableRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [ diff --git a/tests/Rules/NoDynamicNameRule/NoDynamicNameRuleTest.php b/tests/Rules/NoDynamicNameRule/NoDynamicNameRuleTest.php index b021e52c..629352a8 100644 --- a/tests/Rules/NoDynamicNameRule/NoDynamicNameRuleTest.php +++ b/tests/Rules/NoDynamicNameRule/NoDynamicNameRuleTest.php @@ -13,7 +13,7 @@ final class NoDynamicNameRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/DynamicConstantName.php', [[NoDynamicNameRule::ERROR_MESSAGE, 10]]]; diff --git a/tests/Rules/NoGlobalConstRule/NoGlobalConstRuleTest.php b/tests/Rules/NoGlobalConstRule/NoGlobalConstRuleTest.php index 1288e013..0ed822dd 100644 --- a/tests/Rules/NoGlobalConstRule/NoGlobalConstRuleTest.php +++ b/tests/Rules/NoGlobalConstRule/NoGlobalConstRuleTest.php @@ -13,7 +13,7 @@ final class NoGlobalConstRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeGlobalConst.php', [ diff --git a/tests/Rules/NoReferenceRule/NoReferenceRuleTest.php b/tests/Rules/NoReferenceRule/NoReferenceRuleTest.php index 344d3d7a..6c7d2aa6 100644 --- a/tests/Rules/NoReferenceRule/NoReferenceRuleTest.php +++ b/tests/Rules/NoReferenceRule/NoReferenceRuleTest.php @@ -13,7 +13,7 @@ final class NoReferenceRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/MethodWithReference.php', [[NoReferenceRule::ERROR_MESSAGE, 9]]]; diff --git a/tests/Rules/NoReturnSetterMethodRule/NoReturnSetterMethodRuleTest.php b/tests/Rules/NoReturnSetterMethodRule/NoReturnSetterMethodRuleTest.php index fa921b86..e3b8645f 100644 --- a/tests/Rules/NoReturnSetterMethodRule/NoReturnSetterMethodRuleTest.php +++ b/tests/Rules/NoReturnSetterMethodRule/NoReturnSetterMethodRuleTest.php @@ -12,12 +12,18 @@ final class NoReturnSetterMethodRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeSetterClass.php', [[NoReturnSetterMethodRule::ERROR_MESSAGE, 9]]]; diff --git a/tests/Rules/PHPUnit/NoAssertFuncCallInTestsRule/NoAssertFuncCallInTestsRuleTest.php b/tests/Rules/PHPUnit/NoAssertFuncCallInTestsRule/NoAssertFuncCallInTestsRuleTest.php index 5684c13d..64907bc7 100644 --- a/tests/Rules/PHPUnit/NoAssertFuncCallInTestsRule/NoAssertFuncCallInTestsRuleTest.php +++ b/tests/Rules/PHPUnit/NoAssertFuncCallInTestsRule/NoAssertFuncCallInTestsRuleTest.php @@ -12,12 +12,18 @@ final class NoAssertFuncCallInTestsRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/AssertFuncCallInsideTest.php', [[NoAssertFuncCallInTestsRule::ERROR_MESSAGE, 9]]]; diff --git a/tests/Rules/PHPUnit/NoDoubleConsecutiveTestMockRule/NoDoubleConsecutiveTestMockRuleTest.php b/tests/Rules/PHPUnit/NoDoubleConsecutiveTestMockRule/NoDoubleConsecutiveTestMockRuleTest.php index 5f344021..c445937c 100644 --- a/tests/Rules/PHPUnit/NoDoubleConsecutiveTestMockRule/NoDoubleConsecutiveTestMockRuleTest.php +++ b/tests/Rules/PHPUnit/NoDoubleConsecutiveTestMockRule/NoDoubleConsecutiveTestMockRuleTest.php @@ -12,12 +12,18 @@ final class NoDoubleConsecutiveTestMockRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/WillReturnAndWithConsecutive.php', [[NoDoubleConsecutiveTestMockRule::ERROR_MESSAGE, 11]]]; diff --git a/tests/Rules/PHPUnit/NoEntityMockingRule/NoEntityMockingRuleTest.php b/tests/Rules/PHPUnit/NoEntityMockingRule/NoEntityMockingRuleTest.php index 8493470a..5eec3b7c 100644 --- a/tests/Rules/PHPUnit/NoEntityMockingRule/NoEntityMockingRuleTest.php +++ b/tests/Rules/PHPUnit/NoEntityMockingRule/NoEntityMockingRuleTest.php @@ -12,12 +12,18 @@ final class NoEntityMockingRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/MockingEntity.php', [[NoEntityMockingRule::ERROR_MESSAGE, 12]]]; diff --git a/tests/Rules/PHPUnit/NoMockObjectAndRealObjectPropertyRule/NoMockObjectAndRealObjectPropertyRuleTest.php b/tests/Rules/PHPUnit/NoMockObjectAndRealObjectPropertyRule/NoMockObjectAndRealObjectPropertyRuleTest.php index ba4eb711..a469529d 100644 --- a/tests/Rules/PHPUnit/NoMockObjectAndRealObjectPropertyRule/NoMockObjectAndRealObjectPropertyRuleTest.php +++ b/tests/Rules/PHPUnit/NoMockObjectAndRealObjectPropertyRule/NoMockObjectAndRealObjectPropertyRuleTest.php @@ -12,12 +12,18 @@ final class NoMockObjectAndRealObjectPropertyRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeTestWithMockedProperties.php', [[NoMockObjectAndRealObjectPropertyRule::ERROR_MESSAGE, 10]]]; diff --git a/tests/Rules/PHPUnit/NoMockOnlyTestRule/NoMockOnlyTestRuleTest.php b/tests/Rules/PHPUnit/NoMockOnlyTestRule/NoMockOnlyTestRuleTest.php index f0197271..9a9c276c 100644 --- a/tests/Rules/PHPUnit/NoMockOnlyTestRule/NoMockOnlyTestRuleTest.php +++ b/tests/Rules/PHPUnit/NoMockOnlyTestRule/NoMockOnlyTestRuleTest.php @@ -13,7 +13,7 @@ final class NoMockOnlyTestRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeTestWithOnlyMocks.php', [[NoMockOnlyTestRule::ERROR_MESSAGE, 9]]]; diff --git a/tests/Rules/PHPUnit/NoTestMocksRule/NoTestMocksRuleTest.php b/tests/Rules/PHPUnit/NoTestMocksRule/NoTestMocksRuleTest.php index 9cd4738a..9ef65341 100644 --- a/tests/Rules/PHPUnit/NoTestMocksRule/NoTestMocksRuleTest.php +++ b/tests/Rules/PHPUnit/NoTestMocksRule/NoTestMocksRuleTest.php @@ -12,12 +12,18 @@ final class NoTestMocksRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorMessagesWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void { $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [ diff --git a/tests/Rules/PHPUnit/PublicStaticDataProviderRule/PublicStaticDataProviderRuleTest.php b/tests/Rules/PHPUnit/PublicStaticDataProviderRule/PublicStaticDataProviderRuleTest.php index 6860299b..2eb4ebd7 100644 --- a/tests/Rules/PHPUnit/PublicStaticDataProviderRule/PublicStaticDataProviderRuleTest.php +++ b/tests/Rules/PHPUnit/PublicStaticDataProviderRule/PublicStaticDataProviderRuleTest.php @@ -14,6 +14,7 @@ final class PublicStaticDataProviderRuleTest extends RuleTestCase { /** * @param string[] $filePaths + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void @@ -21,6 +22,9 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void $this->analyse($filePaths, $expectedErrorsWithLines); } + /** + * @return Iterator>, mixed>> + */ public static function provideData(): Iterator { yield [[__DIR__ . '/Fixture/SomeSimpleTest.php'], [ diff --git a/tests/Rules/PreferredClassRule/PreferredClassRuleTest.php b/tests/Rules/PreferredClassRule/PreferredClassRuleTest.php index df4689d8..b3386856 100644 --- a/tests/Rules/PreferredClassRule/PreferredClassRuleTest.php +++ b/tests/Rules/PreferredClassRule/PreferredClassRuleTest.php @@ -17,7 +17,7 @@ final class PreferredClassRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -25,6 +25,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(PreferredClassRule::ERROR_MESSAGE, NativeDateTime::class, DateTime::class); diff --git a/tests/Rules/PreventParentMethodVisibilityOverrideRule/PreventParentMethodVisibilityOverrideRuleTest.php b/tests/Rules/PreventParentMethodVisibilityOverrideRule/PreventParentMethodVisibilityOverrideRuleTest.php index f41157b5..9a55597e 100644 --- a/tests/Rules/PreventParentMethodVisibilityOverrideRule/PreventParentMethodVisibilityOverrideRuleTest.php +++ b/tests/Rules/PreventParentMethodVisibilityOverrideRule/PreventParentMethodVisibilityOverrideRuleTest.php @@ -13,7 +13,7 @@ final class PreventParentMethodVisibilityOverrideRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { $errorMessage = sprintf(PreventParentMethodVisibilityOverrideRule::ERROR_MESSAGE, 'run', 'protected'); diff --git a/tests/Rules/Rector/AvoidFeatureSetAttributeInRectorRule/AvoidFeatureSetAttributeInRectorRuleTest.php b/tests/Rules/Rector/AvoidFeatureSetAttributeInRectorRule/AvoidFeatureSetAttributeInRectorRuleTest.php index 257c1b7f..9ea9adb4 100644 --- a/tests/Rules/Rector/AvoidFeatureSetAttributeInRectorRule/AvoidFeatureSetAttributeInRectorRuleTest.php +++ b/tests/Rules/Rector/AvoidFeatureSetAttributeInRectorRule/AvoidFeatureSetAttributeInRectorRuleTest.php @@ -12,12 +12,18 @@ final class AvoidFeatureSetAttributeInRectorRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SetLocalAttribute.php', [[ diff --git a/tests/Rules/Rector/NoClassReflectionStaticReflectionRule/NoClassReflectionStaticReflectionRuleTest.php b/tests/Rules/Rector/NoClassReflectionStaticReflectionRule/NoClassReflectionStaticReflectionRuleTest.php index 5c2a3ea8..5e3e6121 100644 --- a/tests/Rules/Rector/NoClassReflectionStaticReflectionRule/NoClassReflectionStaticReflectionRuleTest.php +++ b/tests/Rules/Rector/NoClassReflectionStaticReflectionRule/NoClassReflectionStaticReflectionRuleTest.php @@ -12,12 +12,18 @@ final class NoClassReflectionStaticReflectionRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/NewOnExternal.php', [[NoClassReflectionStaticReflectionRule::ERROR_MESSAGE, 13]]]; @@ -26,6 +32,9 @@ public static function provideData(): Iterator yield [__DIR__ . '/Fixture/SkipNonReflectionNew.php', []]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Rector/NoInstanceOfStaticReflectionRule/NoInstanceOfStaticReflectionRuleTest.php b/tests/Rules/Rector/NoInstanceOfStaticReflectionRule/NoInstanceOfStaticReflectionRuleTest.php index a8ce9813..5d4ef22f 100644 --- a/tests/Rules/Rector/NoInstanceOfStaticReflectionRule/NoInstanceOfStaticReflectionRuleTest.php +++ b/tests/Rules/Rector/NoInstanceOfStaticReflectionRule/NoInstanceOfStaticReflectionRuleTest.php @@ -12,12 +12,18 @@ final class NoInstanceOfStaticReflectionRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = NoInstanceOfStaticReflectionRule::ERROR_MESSAGE; @@ -39,6 +45,9 @@ public static function provideData(): Iterator yield [__DIR__ . '/Fixture/SkipSelfType.php', []]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Rector/NoIntegerRefactorReturnRule/NoIntegerRefactorReturnRuleTest.php b/tests/Rules/Rector/NoIntegerRefactorReturnRule/NoIntegerRefactorReturnRuleTest.php index b89525f8..7819587b 100644 --- a/tests/Rules/Rector/NoIntegerRefactorReturnRule/NoIntegerRefactorReturnRuleTest.php +++ b/tests/Rules/Rector/NoIntegerRefactorReturnRule/NoIntegerRefactorReturnRuleTest.php @@ -12,12 +12,18 @@ final class NoIntegerRefactorReturnRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = NoIntegerRefactorReturnRule::ERROR_MESSAGE; diff --git a/tests/Rules/Rector/NoLeadingBackslashInNameRule/NoLeadingBackslashInNameRuleTest.php b/tests/Rules/Rector/NoLeadingBackslashInNameRule/NoLeadingBackslashInNameRuleTest.php index 592f0422..a265aed2 100644 --- a/tests/Rules/Rector/NoLeadingBackslashInNameRule/NoLeadingBackslashInNameRuleTest.php +++ b/tests/Rules/Rector/NoLeadingBackslashInNameRule/NoLeadingBackslashInNameRuleTest.php @@ -12,12 +12,18 @@ final class NoLeadingBackslashInNameRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = NoLeadingBackslashInNameRule::ERROR_MESSAGE; @@ -27,6 +33,9 @@ public static function provideData(): Iterator yield [__DIR__ . '/Fixture/SkipUseFullyQualified.php', []]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Rector/NoOnlyNullReturnInRefactorRule/NoOnlyNullReturnInRefactorRuleTest.php b/tests/Rules/Rector/NoOnlyNullReturnInRefactorRule/NoOnlyNullReturnInRefactorRuleTest.php index 9293b5b7..9f6d20ba 100644 --- a/tests/Rules/Rector/NoOnlyNullReturnInRefactorRule/NoOnlyNullReturnInRefactorRuleTest.php +++ b/tests/Rules/Rector/NoOnlyNullReturnInRefactorRule/NoOnlyNullReturnInRefactorRuleTest.php @@ -12,12 +12,18 @@ final class NoOnlyNullReturnInRefactorRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/RefactorOnlyReturnNull.php', [[NoOnlyNullReturnInRefactorRule::ERROR_MESSAGE, 18]]]; diff --git a/tests/Rules/Rector/NoPropertyNodeAssignRule/NoPropertyNodeAssignRuleTest.php b/tests/Rules/Rector/NoPropertyNodeAssignRule/NoPropertyNodeAssignRuleTest.php index 665bf6e6..b617c21c 100644 --- a/tests/Rules/Rector/NoPropertyNodeAssignRule/NoPropertyNodeAssignRuleTest.php +++ b/tests/Rules/Rector/NoPropertyNodeAssignRule/NoPropertyNodeAssignRuleTest.php @@ -12,12 +12,18 @@ final class NoPropertyNodeAssignRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeNodePropertyAssign.php', [ diff --git a/tests/Rules/Rector/PhpUpgradeDowngradeRegisteredInSetRule/PhpUpgradeDowngradeRegisteredInSetRuleTest.php b/tests/Rules/Rector/PhpUpgradeDowngradeRegisteredInSetRule/PhpUpgradeDowngradeRegisteredInSetRuleTest.php index fdec8a2d..0ffae0d9 100644 --- a/tests/Rules/Rector/PhpUpgradeDowngradeRegisteredInSetRule/PhpUpgradeDowngradeRegisteredInSetRuleTest.php +++ b/tests/Rules/Rector/PhpUpgradeDowngradeRegisteredInSetRule/PhpUpgradeDowngradeRegisteredInSetRuleTest.php @@ -14,12 +14,18 @@ final class PhpUpgradeDowngradeRegisteredInSetRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipSomePhpFeatureRector.php', []]; diff --git a/tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest.php b/tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest.php index a9c5aafc..ad674e9e 100644 --- a/tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest.php +++ b/tests/Rules/Rector/PhpUpgradeImplementsMinPhpVersionInterfaceRule/PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest.php @@ -8,16 +8,23 @@ use PHPStan\Rules\Rule; use PHPStan\Testing\RuleTestCase; use PHPUnit\Framework\Attributes\DataProvider; +use Rector\Php80\Rector\Class_\SomePhpFeatureRector; use Symplify\PHPStanRules\Rules\Rector\PhpUpgradeImplementsMinPhpVersionInterfaceRule; final class PhpUpgradeImplementsMinPhpVersionInterfaceRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipDowngradeRector.php', []]; @@ -26,13 +33,16 @@ public static function provideData(): Iterator [ sprintf( PhpUpgradeImplementsMinPhpVersionInterfaceRule::ERROR_MESSAGE, - 'Rector\Php80\Rector\Class_\SomePhpFeatureRector', + SomePhpFeatureRector::class, ), 7, ], ]]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Rector/PreferDirectIsNameRule/PreferDirectIsNameRuleTest.php b/tests/Rules/Rector/PreferDirectIsNameRule/PreferDirectIsNameRuleTest.php index bfe44c94..0b1b0c30 100644 --- a/tests/Rules/Rector/PreferDirectIsNameRule/PreferDirectIsNameRuleTest.php +++ b/tests/Rules/Rector/PreferDirectIsNameRule/PreferDirectIsNameRuleTest.php @@ -12,12 +12,18 @@ final class PreferDirectIsNameRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipDirectIsName.php', []]; diff --git a/tests/Rules/RequireAttributeNameRule/RequireAttributeNameRuleTest.php b/tests/Rules/RequireAttributeNameRule/RequireAttributeNameRuleTest.php index 27cd36e5..f766e248 100644 --- a/tests/Rules/RequireAttributeNameRule/RequireAttributeNameRuleTest.php +++ b/tests/Rules/RequireAttributeNameRule/RequireAttributeNameRuleTest.php @@ -12,12 +12,18 @@ final class RequireAttributeNameRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/MissingName.php', [[RequireAttributeNameRule::ERROR_MESSAGE, 11]]]; diff --git a/tests/Rules/SeeAnnotationToTestRule/SeeAnnotationToTestRuleTest.php b/tests/Rules/SeeAnnotationToTestRule/SeeAnnotationToTestRuleTest.php index cd2095c3..5862f012 100644 --- a/tests/Rules/SeeAnnotationToTestRule/SeeAnnotationToTestRuleTest.php +++ b/tests/Rules/SeeAnnotationToTestRule/SeeAnnotationToTestRuleTest.php @@ -15,7 +15,7 @@ final class SeeAnnotationToTestRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -23,6 +23,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(SeeAnnotationToTestRule::ERROR_MESSAGE, RuleWithoutSee::class); diff --git a/tests/Rules/StringFileAbsolutePathExistsRule/StringFileAbsolutePathExistsRuleTest.php b/tests/Rules/StringFileAbsolutePathExistsRule/StringFileAbsolutePathExistsRuleTest.php index 1519bba1..bf39d2fc 100644 --- a/tests/Rules/StringFileAbsolutePathExistsRule/StringFileAbsolutePathExistsRuleTest.php +++ b/tests/Rules/StringFileAbsolutePathExistsRule/StringFileAbsolutePathExistsRuleTest.php @@ -13,7 +13,7 @@ final class StringFileAbsolutePathExistsRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $errorMessage = sprintf(StringFileAbsolutePathExistsRule::ERROR_MESSAGE, __DIR__ . '/Fixture/some_file.yml'); diff --git a/tests/Rules/Symfony/ConfigClosure/AlreadyRegisteredAutodiscoveryServiceRule/AlreadyRegisteredAutodiscoveryServiceRuleTest.php b/tests/Rules/Symfony/ConfigClosure/AlreadyRegisteredAutodiscoveryServiceRule/AlreadyRegisteredAutodiscoveryServiceRuleTest.php index 3d125fd5..760ef5c4 100644 --- a/tests/Rules/Symfony/ConfigClosure/AlreadyRegisteredAutodiscoveryServiceRule/AlreadyRegisteredAutodiscoveryServiceRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/AlreadyRegisteredAutodiscoveryServiceRule/AlreadyRegisteredAutodiscoveryServiceRuleTest.php @@ -14,7 +14,7 @@ final class AlreadyRegisteredAutodiscoveryServiceRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -22,6 +22,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/DuplicatedServiceRegistration.php', [[ diff --git a/tests/Rules/Symfony/ConfigClosure/FileNameMatchesExtensionRule/FileNameMatchesExtensionRuleTest.php b/tests/Rules/Symfony/ConfigClosure/FileNameMatchesExtensionRule/FileNameMatchesExtensionRuleTest.php index 9ed7a9d8..4aa3739c 100644 --- a/tests/Rules/Symfony/ConfigClosure/FileNameMatchesExtensionRule/FileNameMatchesExtensionRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/FileNameMatchesExtensionRule/FileNameMatchesExtensionRuleTest.php @@ -13,7 +13,7 @@ final class FileNameMatchesExtensionRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/framework.php', []]; diff --git a/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgAutowireByTypeRule/NoDuplicateArgAutowireByTypeRuleTest.php b/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgAutowireByTypeRule/NoDuplicateArgAutowireByTypeRuleTest.php index 8067fb37..bd988b7f 100644 --- a/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgAutowireByTypeRule/NoDuplicateArgAutowireByTypeRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgAutowireByTypeRule/NoDuplicateArgAutowireByTypeRuleTest.php @@ -14,7 +14,7 @@ final class NoDuplicateArgAutowireByTypeRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -22,6 +22,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipDifferentValue.php', []]; @@ -32,6 +35,9 @@ public static function provideData(): Iterator ]]]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgsAutowireByTypeRule/NoDuplicateArgsAutowireByTypeRuleTest.php b/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgsAutowireByTypeRule/NoDuplicateArgsAutowireByTypeRuleTest.php index d40ed492..6deb60e3 100644 --- a/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgsAutowireByTypeRule/NoDuplicateArgsAutowireByTypeRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/NoDuplicateArgsAutowireByTypeRule/NoDuplicateArgsAutowireByTypeRuleTest.php @@ -14,7 +14,7 @@ final class NoDuplicateArgsAutowireByTypeRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -22,6 +22,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/ConfigWithArgs.php', [[ @@ -32,6 +35,9 @@ public static function provideData(): Iterator yield [__DIR__ . '/Fixture/SkipConfigWithDifferentArgs.php', []]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Symfony/ConfigClosure/NoServiceSameNameSetClassRule/NoServiceSameNameSetClassRuleTest.php b/tests/Rules/Symfony/ConfigClosure/NoServiceSameNameSetClassRule/NoServiceSameNameSetClassRuleTest.php index ee8e8bd9..6f6aa192 100644 --- a/tests/Rules/Symfony/ConfigClosure/NoServiceSameNameSetClassRule/NoServiceSameNameSetClassRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/NoServiceSameNameSetClassRule/NoServiceSameNameSetClassRuleTest.php @@ -13,7 +13,7 @@ final class NoServiceSameNameSetClassRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeConfigWithInvalidSet.php', [ diff --git a/tests/Rules/Symfony/ConfigClosure/NoSetClassServiceDuplicationRule/NoSetClassServiceDuplicationRuleTest.php b/tests/Rules/Symfony/ConfigClosure/NoSetClassServiceDuplicationRule/NoSetClassServiceDuplicationRuleTest.php index a914c915..a69895a5 100644 --- a/tests/Rules/Symfony/ConfigClosure/NoSetClassServiceDuplicationRule/NoSetClassServiceDuplicationRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/NoSetClassServiceDuplicationRule/NoSetClassServiceDuplicationRuleTest.php @@ -13,7 +13,7 @@ final class NoSetClassServiceDuplicationRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SetAndClassConfig.php', [ diff --git a/tests/Rules/Symfony/ConfigClosure/PreferAutowireAttributeOverConfigParamRule/PreferAutowireAttributeOverConfigParamRuleTest.php b/tests/Rules/Symfony/ConfigClosure/PreferAutowireAttributeOverConfigParamRule/PreferAutowireAttributeOverConfigParamRuleTest.php index e1d1fce8..a606ddad 100644 --- a/tests/Rules/Symfony/ConfigClosure/PreferAutowireAttributeOverConfigParamRule/PreferAutowireAttributeOverConfigParamRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/PreferAutowireAttributeOverConfigParamRule/PreferAutowireAttributeOverConfigParamRuleTest.php @@ -14,7 +14,7 @@ final class PreferAutowireAttributeOverConfigParamRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -22,6 +22,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeConfigWithInvalidSet.php', [ @@ -41,6 +44,9 @@ public static function provideData(): Iterator yield [__DIR__ . '/Fixture/SkipNoParameterReference.php', []]; } + /** + * @return array + */ public static function getAdditionalConfigFiles(): array { return [__DIR__ . '/config/configured_rule.neon']; diff --git a/tests/Rules/Symfony/ConfigClosure/ServicesExcludedDirectoryMustExistRule/ServicesExcludedDirectoryMustExistRuleTest.php b/tests/Rules/Symfony/ConfigClosure/ServicesExcludedDirectoryMustExistRule/ServicesExcludedDirectoryMustExistRuleTest.php index 4aab0e2d..7304f1da 100644 --- a/tests/Rules/Symfony/ConfigClosure/ServicesExcludedDirectoryMustExistRule/ServicesExcludedDirectoryMustExistRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/ServicesExcludedDirectoryMustExistRule/ServicesExcludedDirectoryMustExistRuleTest.php @@ -13,7 +13,7 @@ final class ServicesExcludedDirectoryMustExistRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipInvalidPath.php', []]; diff --git a/tests/Rules/Symfony/ConfigClosure/TaggedIteratorOverRepeatedServiceCallRule/TaggedIteratorOverRepeatedServiceCallRuleTest.php b/tests/Rules/Symfony/ConfigClosure/TaggedIteratorOverRepeatedServiceCallRule/TaggedIteratorOverRepeatedServiceCallRuleTest.php index 82720f74..3bc789ad 100644 --- a/tests/Rules/Symfony/ConfigClosure/TaggedIteratorOverRepeatedServiceCallRule/TaggedIteratorOverRepeatedServiceCallRuleTest.php +++ b/tests/Rules/Symfony/ConfigClosure/TaggedIteratorOverRepeatedServiceCallRule/TaggedIteratorOverRepeatedServiceCallRuleTest.php @@ -13,7 +13,7 @@ final class TaggedIteratorOverRepeatedServiceCallRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/ConfigWithRepeatedCalls.php', [ diff --git a/tests/Rules/Symfony/FormTypeClassNameRule/FormTypeClassNameRuleTest.php b/tests/Rules/Symfony/FormTypeClassNameRule/FormTypeClassNameRuleTest.php index e6059270..7dadac08 100644 --- a/tests/Rules/Symfony/FormTypeClassNameRule/FormTypeClassNameRuleTest.php +++ b/tests/Rules/Symfony/FormTypeClassNameRule/FormTypeClassNameRuleTest.php @@ -15,7 +15,7 @@ final class FormTypeClassNameRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -23,6 +23,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeFormType.php', []]; diff --git a/tests/Rules/Symfony/NoAbstractControllerConstructorRule/NoAbstractControllerConstructorRuleTest.php b/tests/Rules/Symfony/NoAbstractControllerConstructorRule/NoAbstractControllerConstructorRuleTest.php index 8639a1a8..1eab14f2 100644 --- a/tests/Rules/Symfony/NoAbstractControllerConstructorRule/NoAbstractControllerConstructorRuleTest.php +++ b/tests/Rules/Symfony/NoAbstractControllerConstructorRule/NoAbstractControllerConstructorRuleTest.php @@ -13,7 +13,7 @@ final class NoAbstractControllerConstructorRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeAbstractController.php', [[ diff --git a/tests/Rules/Symfony/NoBareAndSecurityIsGrantedContentsRule/NoBareAndSecurityIsGrantedContentsRuleTest.php b/tests/Rules/Symfony/NoBareAndSecurityIsGrantedContentsRule/NoBareAndSecurityIsGrantedContentsRuleTest.php index d973ad29..f715d7c0 100644 --- a/tests/Rules/Symfony/NoBareAndSecurityIsGrantedContentsRule/NoBareAndSecurityIsGrantedContentsRuleTest.php +++ b/tests/Rules/Symfony/NoBareAndSecurityIsGrantedContentsRule/NoBareAndSecurityIsGrantedContentsRuleTest.php @@ -13,7 +13,7 @@ final class NoBareAndSecurityIsGrantedContentsRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeControllerWithComplexAttribute.php', [ diff --git a/tests/Rules/Symfony/NoClassLevelRouteRule/NoClassLevelRouteRuleTest.php b/tests/Rules/Symfony/NoClassLevelRouteRule/NoClassLevelRouteRuleTest.php index d5ff98a2..5f8b4093 100644 --- a/tests/Rules/Symfony/NoClassLevelRouteRule/NoClassLevelRouteRuleTest.php +++ b/tests/Rules/Symfony/NoClassLevelRouteRule/NoClassLevelRouteRuleTest.php @@ -14,6 +14,7 @@ final class NoClassLevelRouteRuleTest extends RuleTestCase { /** * @param string[] $filePaths + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void @@ -21,6 +22,9 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void $this->analyse($filePaths, $expectedErrorsWithLines); } + /** + * @return Iterator>, mixed>> + */ public static function provideData(): Iterator { yield [[ diff --git a/tests/Rules/Symfony/NoConstructorAndRequiredTogetherRule/NoConstructorAndRequiredTogetherRuleTest.php b/tests/Rules/Symfony/NoConstructorAndRequiredTogetherRule/NoConstructorAndRequiredTogetherRuleTest.php index 2301aafa..e9d7213f 100644 --- a/tests/Rules/Symfony/NoConstructorAndRequiredTogetherRule/NoConstructorAndRequiredTogetherRuleTest.php +++ b/tests/Rules/Symfony/NoConstructorAndRequiredTogetherRule/NoConstructorAndRequiredTogetherRuleTest.php @@ -13,7 +13,7 @@ final class NoConstructorAndRequiredTogetherRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/ConstructorAndRequiredInSingleClass.php', [[ diff --git a/tests/Rules/Symfony/NoControllerMethodInjectionRule/NoControllerMethodInjectionRuleTest.php b/tests/Rules/Symfony/NoControllerMethodInjectionRule/NoControllerMethodInjectionRuleTest.php index 811867cf..4761594f 100644 --- a/tests/Rules/Symfony/NoControllerMethodInjectionRule/NoControllerMethodInjectionRuleTest.php +++ b/tests/Rules/Symfony/NoControllerMethodInjectionRule/NoControllerMethodInjectionRuleTest.php @@ -14,7 +14,7 @@ final class NoControllerMethodInjectionRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -22,6 +22,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeActionInjectionController.php', [[ diff --git a/tests/Rules/Symfony/NoGetInCommandRule/NoGetInCommandRuleTest.php b/tests/Rules/Symfony/NoGetInCommandRule/NoGetInCommandRuleTest.php index aea9c469..8705800c 100644 --- a/tests/Rules/Symfony/NoGetInCommandRule/NoGetInCommandRuleTest.php +++ b/tests/Rules/Symfony/NoGetInCommandRule/NoGetInCommandRuleTest.php @@ -13,7 +13,7 @@ final class NoGetInCommandRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SomeCommandWithGet.php', [[NoGetInCommandRule::ERROR_MESSAGE, 14]]]; diff --git a/tests/Rules/Symfony/NoListenerWithoutContractRule/NoListenerWithoutContractRuleTest.php b/tests/Rules/Symfony/NoListenerWithoutContractRule/NoListenerWithoutContractRuleTest.php index 1e5423fd..8066ae32 100644 --- a/tests/Rules/Symfony/NoListenerWithoutContractRule/NoListenerWithoutContractRuleTest.php +++ b/tests/Rules/Symfony/NoListenerWithoutContractRule/NoListenerWithoutContractRuleTest.php @@ -14,6 +14,7 @@ final class NoListenerWithoutContractRuleTest extends RuleTestCase { /** * @param string[] $filePaths + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void @@ -21,6 +22,9 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void $this->analyse($filePaths, $expectedErrorsWithLines); } + /** + * @return Iterator>, mixed>> + */ public static function provideData(): Iterator { // @see https://symfony.com/blog/new-in-symfony-4-1-invokable-event-listeners diff --git a/tests/Rules/Symfony/NoRequiredOutsideClassRule/NoRequiredOutsideClassRuleTest.php b/tests/Rules/Symfony/NoRequiredOutsideClassRule/NoRequiredOutsideClassRuleTest.php index 18cab064..65178fc8 100644 --- a/tests/Rules/Symfony/NoRequiredOutsideClassRule/NoRequiredOutsideClassRuleTest.php +++ b/tests/Rules/Symfony/NoRequiredOutsideClassRule/NoRequiredOutsideClassRuleTest.php @@ -14,6 +14,7 @@ final class NoRequiredOutsideClassRuleTest extends RuleTestCase { /** * @param string[] $filePaths + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void @@ -21,6 +22,9 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void $this->analyse($filePaths, $expectedErrorsWithLines); } + /** + * @return Iterator>, mixed>> + */ public static function provideData(): Iterator { yield [[ diff --git a/tests/Rules/Symfony/NoRouteTrailingSlashPathRule/NoRouteTrailingSlashPathRuleTest.php b/tests/Rules/Symfony/NoRouteTrailingSlashPathRule/NoRouteTrailingSlashPathRuleTest.php index d697d3e8..b90d060f 100644 --- a/tests/Rules/Symfony/NoRouteTrailingSlashPathRule/NoRouteTrailingSlashPathRuleTest.php +++ b/tests/Rules/Symfony/NoRouteTrailingSlashPathRule/NoRouteTrailingSlashPathRuleTest.php @@ -13,7 +13,7 @@ final class NoRouteTrailingSlashPathRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorsWithLines + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorsWithLines): void $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SoleSlashController.php', []]; diff --git a/tests/Rules/Symfony/NoRoutingPrefixRule/NoRoutingPrefixRuleTest.php b/tests/Rules/Symfony/NoRoutingPrefixRule/NoRoutingPrefixRuleTest.php index aaf7f015..7a4087a3 100644 --- a/tests/Rules/Symfony/NoRoutingPrefixRule/NoRoutingPrefixRuleTest.php +++ b/tests/Rules/Symfony/NoRoutingPrefixRule/NoRoutingPrefixRuleTest.php @@ -14,6 +14,7 @@ final class NoRoutingPrefixRuleTest extends RuleTestCase { /** * @param string[] $filePaths + * @param array> $expectedErrorsWithLines */ #[DataProvider('provideData')] public function testRule(array $filePaths, array $expectedErrorsWithLines): void @@ -21,6 +22,9 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void $this->analyse($filePaths, $expectedErrorsWithLines); } + /** + * @return Iterator>, mixed>> + */ public static function provideData(): Iterator { yield [[ diff --git a/tests/Rules/Symfony/NoServiceAutowireDuplicateRule/NoServiceAutowireDuplicateRuleTest.php b/tests/Rules/Symfony/NoServiceAutowireDuplicateRule/NoServiceAutowireDuplicateRuleTest.php index 600d6237..5ffb791f 100644 --- a/tests/Rules/Symfony/NoServiceAutowireDuplicateRule/NoServiceAutowireDuplicateRuleTest.php +++ b/tests/Rules/Symfony/NoServiceAutowireDuplicateRule/NoServiceAutowireDuplicateRuleTest.php @@ -12,12 +12,18 @@ final class NoServiceAutowireDuplicateRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorMessagesWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void { $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/DuplicatedAutowire.php', [[ diff --git a/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRulePhp80Test.php b/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRulePhp80Test.php index fafaf80e..7ef20201 100644 --- a/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRulePhp80Test.php +++ b/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRulePhp80Test.php @@ -13,7 +13,7 @@ final class RequireInvokableControllerRulePhp80Test extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { yield [ diff --git a/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRuleTest.php b/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRuleTest.php index b2a1c25b..b85378bd 100644 --- a/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRuleTest.php +++ b/tests/Rules/Symfony/RequireInvokableControllerRule/RequireInvokableControllerRuleTest.php @@ -13,7 +13,7 @@ final class RequireInvokableControllerRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipInvokableController.php', []]; diff --git a/tests/Rules/Symfony/RequireIsGrantedEnumRule/RequireIsGrantedEnumRuleTest.php b/tests/Rules/Symfony/RequireIsGrantedEnumRule/RequireIsGrantedEnumRuleTest.php index ebdd08a5..d3f72db7 100644 --- a/tests/Rules/Symfony/RequireIsGrantedEnumRule/RequireIsGrantedEnumRuleTest.php +++ b/tests/Rules/Symfony/RequireIsGrantedEnumRule/RequireIsGrantedEnumRuleTest.php @@ -13,7 +13,7 @@ final class RequireIsGrantedEnumRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/SkipConstantResource.php', []]; diff --git a/tests/Rules/Symfony/RequireRouteNameToGenerateControllerRouteRule/RequireRouteNameToGenerateControllerRouteRuleTest.php b/tests/Rules/Symfony/RequireRouteNameToGenerateControllerRouteRule/RequireRouteNameToGenerateControllerRouteRuleTest.php index acf321d7..dbea903e 100644 --- a/tests/Rules/Symfony/RequireRouteNameToGenerateControllerRouteRule/RequireRouteNameToGenerateControllerRouteRuleTest.php +++ b/tests/Rules/Symfony/RequireRouteNameToGenerateControllerRouteRule/RequireRouteNameToGenerateControllerRouteRuleTest.php @@ -14,7 +14,7 @@ final class RequireRouteNameToGenerateControllerRouteRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -22,6 +22,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/CallingCorrectController.php', []]; diff --git a/tests/Rules/Symfony/RequiredOnlyInAbstractRule/RequiredOnlyInAbstractRuleTest.php b/tests/Rules/Symfony/RequiredOnlyInAbstractRule/RequiredOnlyInAbstractRuleTest.php index 283db7e4..6d5a7fbc 100644 --- a/tests/Rules/Symfony/RequiredOnlyInAbstractRule/RequiredOnlyInAbstractRuleTest.php +++ b/tests/Rules/Symfony/RequiredOnlyInAbstractRule/RequiredOnlyInAbstractRuleTest.php @@ -12,12 +12,18 @@ final class RequiredOnlyInAbstractRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorMessagesWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void { $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/NonAbstractControllerWithRequired.php', [[ diff --git a/tests/Rules/Symfony/SingleArgEventDispatchRule/SingleArgEventDispatchRuleTest.php b/tests/Rules/Symfony/SingleArgEventDispatchRule/SingleArgEventDispatchRuleTest.php index 485f7b9c..40d173be 100644 --- a/tests/Rules/Symfony/SingleArgEventDispatchRule/SingleArgEventDispatchRuleTest.php +++ b/tests/Rules/Symfony/SingleArgEventDispatchRule/SingleArgEventDispatchRuleTest.php @@ -12,12 +12,18 @@ final class SingleArgEventDispatchRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { yield [__DIR__ . '/Fixture/ReportEventDispatcher.php', [[SingleArgEventDispatchRule::ERROR_MESSAGE, 11]]]; diff --git a/tests/Rules/Symfony/SingleRequiredMethodRule/SingleRequiredMethodRuleTest.php b/tests/Rules/Symfony/SingleRequiredMethodRule/SingleRequiredMethodRuleTest.php index 6bcb74c8..55639498 100644 --- a/tests/Rules/Symfony/SingleRequiredMethodRule/SingleRequiredMethodRuleTest.php +++ b/tests/Rules/Symfony/SingleRequiredMethodRule/SingleRequiredMethodRuleTest.php @@ -12,12 +12,18 @@ final class SingleRequiredMethodRuleTest extends RuleTestCase { + /** + * @param array> $expectedErrorsWithLines + */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorsWithLines): void { $this->analyse([$filePath], $expectedErrorsWithLines); } + /** + * @return Iterator, mixed>> + */ public static function provideData(): Iterator { $expectedErrorMessage = sprintf(SingleRequiredMethodRule::ERROR_MESSAGE, 2); diff --git a/tests/Rules/UppercaseConstantRule/UppercaseConstantRuleTest.php b/tests/Rules/UppercaseConstantRule/UppercaseConstantRuleTest.php index 892ee354..e8ad9457 100644 --- a/tests/Rules/UppercaseConstantRule/UppercaseConstantRuleTest.php +++ b/tests/Rules/UppercaseConstantRule/UppercaseConstantRuleTest.php @@ -13,7 +13,7 @@ final class UppercaseConstantRuleTest extends RuleTestCase { /** - * @param mixed[] $expectedErrorMessagesWithLines + * @param array> $expectedErrorMessagesWithLines */ #[DataProvider('provideData')] public function testRule(string $filePath, array $expectedErrorMessagesWithLines): void @@ -21,6 +21,9 @@ public function testRule(string $filePath, array $expectedErrorMessagesWithLines $this->analyse([$filePath], $expectedErrorMessagesWithLines); } + /** + * @return Iterator<(array>>|array>>|array)> + */ public static function provideData(): Iterator { $errorMessage = sprintf(UppercaseConstantRule::ERROR_MESSAGE, 'SMall');