From b5d8d917ea04f817ba00ef76979b23ec1e0cccce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Thu, 22 Jun 2023 14:45:07 +0200 Subject: [PATCH] DX: make data providers return type "iterable" (#7072) --- ...bstractDoctrineAnnotationFixerTestCase.php | 2 +- tests/AbstractFunctionReferenceFixerTest.php | 2 +- tests/AutoReview/CommandTest.php | 2 +- tests/AutoReview/ProjectCodeTest.php | 8 +- tests/AutoReview/TransformerTest.php | 4 +- tests/Cache/CacheTest.php | 4 +- tests/ConfigTest.php | 2 +- .../FixCommandExitStatusCalculatorTest.php | 2 +- .../Console/Command/SelfUpdateCommandTest.php | 8 +- tests/Console/ConfigurationResolverTest.php | 16 +-- tests/Console/Output/ErrorOutputTest.php | 2 +- tests/Console/Output/ProcessOutputTest.php | 2 +- .../FixReport/AbstractReporterTestCase.php | 2 +- .../SelfUpdate/NewVersionCheckerTest.php | 4 +- tests/Differ/DiffConsoleFormatterTest.php | 2 +- tests/DocBlock/AnnotationTest.php | 8 +- tests/DocBlock/DocBlockTest.php | 4 +- tests/DocBlock/ShortDescriptionTest.php | 2 +- tests/DocBlock/TagComparatorTest.php | 4 +- tests/DocBlock/TagTest.php | 4 +- tests/Doctrine/Annotation/TokenTest.php | 4 +- .../Alias/BacktickToShellExecFixerTest.php | 2 +- tests/Fixer/Alias/MbStrFunctionsFixerTest.php | 2 +- .../NoAliasLanguageConstructCallFixerTest.php | 2 +- .../Fixer/Alias/NoMixedEchoPrintFixerTest.php | 2 +- .../Alias/PowToExponentiationFixerTest.php | 4 +- .../Alias/RandomApiMigrationFixerTest.php | 2 +- tests/Fixer/Alias/SetTypeToCastFixerTest.php | 2 +- .../ArrayNotation/ArraySyntaxFixerTest.php | 4 +- ...neWhitespaceAroundDoubleArrowFixerTest.php | 2 +- ...railingCommaInSinglelineArrayFixerTest.php | 2 +- ...oWhitespaceBeforeCommaInArrayFixerTest.php | 2 +- .../NormalizeIndexBraceFixerTest.php | 2 +- .../TrimArraySpacesFixerTest.php | 2 +- .../WhitespaceAfterCommaInArrayFixerTest.php | 2 +- .../NoTrailingCommaInSinglelineFixerTest.php | 2 +- .../Basic/NonPrintableCharacterFixerTest.php | 4 +- tests/Fixer/Basic/PsrAutoloadingFixerTest.php | 2 +- tests/Fixer/Casing/ConstantCaseFixerTest.php | 2 +- .../Casing/LowercaseKeywordsFixerTest.php | 2 +- .../LowercaseStaticReferenceFixerTest.php | 2 +- .../Casing/MagicConstantCasingFixerTest.php | 4 +- .../Casing/MagicMethodCasingFixerTest.php | 2 +- .../Casing/NativeFunctionCasingFixerTest.php | 2 +- ...FunctionTypeDeclarationCasingFixerTest.php | 2 +- .../CastNotation/CastSpacesFixerTest.php | 4 +- .../CastNotation/NoShortBoolCastFixerTest.php | 2 +- .../CastNotation/NoUnsetCastFixerTest.php | 2 +- .../CastNotation/ShortScalarCastFixerTest.php | 2 +- .../ClassAttributesSeparationFixerTest.php | 14 +-- .../ClassDefinitionFixerTest.php | 16 +-- .../ClassNotation/FinalClassFixerTest.php | 6 +- .../FinalInternalClassFixerTest.php | 4 +- ...lPublicMethodForAbstractClassFixerTest.php | 2 +- ...NoBlankLinesAfterClassOpeningFixerTest.php | 6 +- .../NoNullPropertyInitializationFixerTest.php | 2 +- .../NoPhp4ConstructorFixerTest.php | 4 +- .../NoUnneededFinalMethodFixerTest.php | 2 +- .../OrderedClassElementsFixerTest.php | 4 +- .../OrderedInterfacesFixerTest.php | 8 +- .../ProtectedToPrivateFixerTest.php | 2 +- .../ClassNotation/SelfAccessorFixerTest.php | 2 +- .../SelfStaticAccessorFixerTest.php | 2 +- ...ingleClassElementPerStatementFixerTest.php | 2 +- ...SingleTraitInsertPerStatementFixerTest.php | 2 +- .../VisibilityRequiredFixerTest.php | 2 +- .../ClassUsage/DateTimeImmutableFixerTest.php | 2 +- .../Comment/CommentToPhpdocFixerTest.php | 2 +- .../Fixer/Comment/HeaderCommentFixerTest.php | 10 +- ...ultilineCommentOpeningClosingFixerTest.php | 2 +- .../Fixer/Comment/NoEmptyCommentFixerTest.php | 4 +- ...NoTrailingWhitespaceInCommentFixerTest.php | 2 +- .../SingleLineCommentStyleFixerTest.php | 6 +- .../NativeConstantInvocationFixerTest.php | 10 +- .../ControlStructure/ElseifFixerTest.php | 2 +- .../NoBreakCommentFixerTest.php | 6 +- .../NoSuperfluousElseifFixerTest.php | 2 +- .../NoTrailingCommaInListCallFixerTest.php | 2 +- .../NoUnneededControlParenthesesFixerTest.php | 2 +- .../NoUselessElseFixerTest.php | 12 +- .../SwitchCaseSemicolonToColonFixerTest.php | 2 +- .../TrailingCommaInMultilineFixerTest.php | 2 +- .../ControlStructure/YodaStyleFixerTest.php | 6 +- ...DoctrineAnnotationIndentationFixerTest.php | 4 +- .../DoctrineAnnotationSpacesFixerTest.php | 30 ++--- .../CombineNestedDirnameFixerTest.php | 2 +- .../FopenFlagOrderFixerTest.php | 2 +- .../FunctionNotation/FopenFlagsFixerTest.php | 4 +- .../FunctionDeclarationFixerTest.php | 2 +- .../FunctionTypehintSpaceFixerTest.php | 2 +- .../LambdaNotUsedImportFixerTest.php | 2 +- .../MethodArgumentSpaceFixerTest.php | 2 +- .../NativeFunctionInvocationFixerTest.php | 10 +- ...reachableDefaultArgumentValueFixerTest.php | 2 +- .../PhpdocToParamTypeFixerTest.php | 2 +- .../PhpdocToPropertyTypeFixerTest.php | 2 +- .../ReturnTypeDeclarationFixerTest.php | 4 +- .../StaticLambdaFixerTest.php | 4 +- .../UseArrowFunctionsFixerTest.php | 2 +- .../FunctionNotation/VoidReturnFixerTest.php | 2 +- .../FullyQualifiedStrictTypesFixerTest.php | 2 +- .../Import/GlobalNamespaceImportFixerTest.php | 12 +- .../Import/NoLeadingImportSlashFixerTest.php | 2 +- .../Fixer/Import/NoUnusedImportsFixerTest.php | 2 +- .../Fixer/Import/OrderedImportsFixerTest.php | 8 +- .../SingleImportPerStatementFixerTest.php | 2 +- .../SingleLineAfterImportsFixerTest.php | 2 +- .../ClassKeywordRemoveFixerTest.php | 2 +- .../CombineConsecutiveIssetsFixerTest.php | 2 +- .../DeclareEqualNormalizeFixerTest.php | 4 +- .../DirConstantFixerTest.php | 2 +- .../ExplicitIndirectVariableFixerTest.php | 4 +- .../FunctionToConstantFixerTest.php | 4 +- .../LanguageConstruct/IsNullFixerTest.php | 2 +- .../SingleSpaceAfterConstructFixerTest.php | 104 +++++++++--------- .../SingleSpaceAroundConstructFixerTest.php | 104 +++++++++--------- .../ListNotation/ListSyntaxFixerTest.php | 2 +- .../BlankLineAfterNamespaceFixerTest.php | 4 +- .../NoBlankLinesBeforeNamespaceFixerTest.php | 2 +- .../NoLeadingNamespaceWhitespaceFixerTest.php | 4 +- ...ingleBlankLineBeforeNamespaceFixerTest.php | 2 +- .../Naming/NoHomoglyphNamesFixerTest.php | 2 +- .../BinaryOperatorSpacesFixerTest.php | 18 +-- tests/Fixer/Operator/ConcatSpaceFixerTest.php | 4 +- .../Operator/IncrementStyleFixerTest.php | 4 +- .../Operator/LogicalOperatorsFixerTest.php | 2 +- .../NotOperatorWithSpaceFixerTest.php | 2 +- ...NotOperatorWithSuccessorSpaceFixerTest.php | 2 +- ...jectOperatorWithoutWhitespaceFixerTest.php | 2 +- .../StandardizeNotEqualsFixerTest.php | 2 +- .../TernaryOperatorSpacesFixerTest.php | 4 +- .../TernaryToElvisOperatorFixerTest.php | 2 +- .../Operator/UnaryOperatorSpacesFixerTest.php | 2 +- .../BlankLineAfterOpeningTagFixerTest.php | 4 +- tests/Fixer/PhpTag/EchoTagSyntaxFixerTest.php | 4 +- .../Fixer/PhpTag/FullOpeningTagFixerTest.php | 2 +- .../LinebreakAfterOpeningTagFixerTest.php | 4 +- tests/Fixer/PhpTag/NoClosingTagFixerTest.php | 4 +- .../PhpUnit/PhpUnitConstructFixerTest.php | 4 +- .../PhpUnitDedicateAssertFixerTest.php | 2 +- .../PhpUnit/PhpUnitExpectationFixerTest.php | 4 +- .../PhpUnit/PhpUnitInternalClassFixerTest.php | 2 +- .../PhpUnit/PhpUnitMethodCasingFixerTest.php | 2 +- tests/Fixer/PhpUnit/PhpUnitMockFixerTest.php | 2 +- .../PhpUnitMockShortWillReturnFixerTest.php | 2 +- .../PhpUnit/PhpUnitNamespacedFixerTest.php | 2 +- ...hpUnitNoExpectationAnnotationFixerTest.php | 4 +- ...hpUnitSetUpTearDownVisibilityFixerTest.php | 2 +- .../PhpUnit/PhpUnitSizeClassFixerTest.php | 2 +- .../Fixer/PhpUnit/PhpUnitStrictFixerTest.php | 2 +- .../PhpUnit/PhpUnitTargetVersionTest.php | 2 +- .../PhpUnitTestAnnotationFixerTest.php | 4 +- ...UnitTestCaseStaticMethodCallsFixerTest.php | 2 +- ...hpUnitTestClassRequiresCoversFixerTest.php | 4 +- .../Phpdoc/AlignMultilineCommentFixerTest.php | 6 +- ...GeneralPhpdocAnnotationRemoveFixerTest.php | 2 +- .../GeneralPhpdocTagRenameFixerTest.php | 4 +- .../NoBlankLinesAfterPhpdocFixerTest.php | 2 +- tests/Fixer/Phpdoc/NoEmptyPhpdocFixerTest.php | 2 +- ...pdocAddMissingParamAnnotationFixerTest.php | 8 +- .../PhpdocAnnotationWithoutDotFixerTest.php | 2 +- tests/Fixer/Phpdoc/PhpdocIndentFixerTest.php | 2 +- .../PhpdocInlineTagNormalizerFixerTest.php | 2 +- .../Fixer/Phpdoc/PhpdocLineSpanFixerTest.php | 2 +- .../Phpdoc/PhpdocNoAliasTagFixerTest.php | 8 +- .../PhpdocNoUselessInheritdocFixerTest.php | 2 +- .../Phpdoc/PhpdocOrderByValueFixerTest.php | 34 +++--- tests/Fixer/Phpdoc/PhpdocOrderFixerTest.php | 6 +- .../PhpdocReturnSelfReferenceFixerTest.php | 8 +- .../Phpdoc/PhpdocSeparationFixerTest.php | 2 +- .../PhpdocSingleLineVarSpacingFixerTest.php | 2 +- tests/Fixer/Phpdoc/PhpdocSummaryFixerTest.php | 4 +- .../Fixer/Phpdoc/PhpdocTagCasingFixerTest.php | 2 +- tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php | 2 +- .../Fixer/Phpdoc/PhpdocToCommentFixerTest.php | 4 +- ...onsecutiveBlankLineSeparationFixerTest.php | 2 +- tests/Fixer/Phpdoc/PhpdocTrimFixerTest.php | 2 +- .../Phpdoc/PhpdocTypesOrderFixerTest.php | 10 +- .../Phpdoc/PhpdocVarWithoutNameFixerTest.php | 2 +- .../NoUselessReturnFixerTest.php | 2 +- .../ReturnAssignmentFixerTest.php | 6 +- .../SimplifiedNullReturnFixerTest.php | 2 +- ...ineWhitespaceBeforeSemicolonsFixerTest.php | 8 +- .../Semicolon/NoEmptyStatementFixerTest.php | 6 +- ...ineWhitespaceBeforeSemicolonsFixerTest.php | 2 +- .../SpaceAfterSemicolonFixerTest.php | 4 +- .../Strict/DeclareStrictTypesFixerTest.php | 6 +- .../Strict/StrictComparisonFixerTest.php | 2 +- tests/Fixer/Strict/StrictParamFixerTest.php | 2 +- .../EscapeImplicitBackslashesFixerTest.php | 2 +- .../ExplicitStringVariableFixerTest.php | 2 +- .../HeredocToNowdocFixerTest.php | 2 +- .../NoBinaryStringFixerTest.php | 2 +- ...SimpleToComplexStringVariableFixerTest.php | 2 +- .../StringNotation/SingleQuoteFixerTest.php | 4 +- .../Whitespace/ArrayIndentationFixerTest.php | 4 +- .../BlankLineBeforeStatementFixerTest.php | 50 ++++----- .../CompactNullableTypehintFixerTest.php | 2 +- .../HeredocIndentationFixerTest.php | 2 +- .../Whitespace/IndentationTypeFixerTest.php | 8 +- .../Fixer/Whitespace/LineEndingFixerTest.php | 2 +- .../MethodChainingIndentationFixerTest.php | 4 +- .../Whitespace/NoExtraBlankLinesFixerTest.php | 8 +- .../NoSpacesAroundOffsetFixerTest.php | 4 +- .../NoSpacesInsideParenthesisFixerTest.php | 2 +- .../NoWhitespaceInBlankLineFixerTest.php | 4 +- .../SingleBlankLineAtEofFixerTest.php | 2 +- .../AliasedFixerOptionTest.php | 14 +-- .../AllowedValueSubsetTest.php | 2 +- .../DeprecatedFixerOptionTest.php | 4 +- .../VersionSpecificCodeSampleTest.php | 2 +- .../VersionSpecificationTest.php | 6 +- tests/FixerFactoryTest.php | 4 +- tests/FixerNameValidatorTest.php | 2 +- tests/Linter/AbstractLinterTestCase.php | 4 +- tests/Linter/CachingLinterTest.php | 2 +- tests/PregTest.php | 2 +- tests/RuleSet/RuleSetsTest.php | 4 +- tests/Smoke/CiIntegrationTest.php | 2 +- tests/Test/AbstractIntegrationTestCase.php | 2 +- .../Analyzer/Analysis/TypeAnalysisTest.php | 2 +- .../Tokenizer/Analyzer/BlocksAnalyzerTest.php | 4 +- .../Analyzer/CommentsAnalyzerTest.php | 10 +- .../Analyzer/NamespaceUsesAnalyzerTest.php | 4 +- .../Analyzer/NamespacesAnalyzerTest.php | 2 +- tests/Tokenizer/TokenTest.php | 14 +-- tests/Tokenizer/TokensAnalyzerTest.php | 22 ++-- tests/Tokenizer/TokensTest.php | 18 +-- .../ArrayTypehintTransformerTest.php | 2 +- ...BraceClassInstantiationTransformerTest.php | 2 +- .../ClassConstantTransformerTest.php | 2 +- .../Transformer/CurlyBraceTransformerTest.php | 4 +- .../Transformer/ImportTransformerTest.php | 2 +- .../NamespaceOperatorTransformerTest.php | 2 +- .../NullableTypeTransformerTest.php | 2 +- .../Transformer/ReturnRefTransformerTest.php | 2 +- .../SquareBraceTransformerTest.php | 6 +- .../Transformer/TypeColonTransformerTest.php | 4 +- .../WhitespacyCommentTransformerTest.php | 2 +- tests/Tokenizer/TransformersTest.php | 2 +- tests/UtilsTest.php | 8 +- tests/WhitespacesFixerConfigTest.php | 2 +- tests/WordMatcherTest.php | 2 +- 243 files changed, 601 insertions(+), 601 deletions(-) diff --git a/tests/AbstractDoctrineAnnotationFixerTestCase.php b/tests/AbstractDoctrineAnnotationFixerTestCase.php index 991a969d83a..388367f505c 100644 --- a/tests/AbstractDoctrineAnnotationFixerTestCase.php +++ b/tests/AbstractDoctrineAnnotationFixerTestCase.php @@ -34,7 +34,7 @@ public function testConfigureWithInvalidConfiguration(array $configuration): voi $this->fixer->configure($configuration); } - public static function provideConfigureWithInvalidConfigurationCases(): array + public static function provideConfigureWithInvalidConfigurationCases(): iterable { return [ [['foo' => 'bar']], diff --git a/tests/AbstractFunctionReferenceFixerTest.php b/tests/AbstractFunctionReferenceFixerTest.php index 7d7c9bdb18f..d2dfb2cf6a9 100644 --- a/tests/AbstractFunctionReferenceFixerTest.php +++ b/tests/AbstractFunctionReferenceFixerTest.php @@ -55,7 +55,7 @@ public function testAbstractFunctionReferenceFixer( self::assertFalse($tokens->isChanged()); } - public static function provideAbstractFunctionReferenceFixerCases(): array + public static function provideAbstractFunctionReferenceFixerCases(): iterable { return [ 'simple case I' => [ diff --git a/tests/AutoReview/CommandTest.php b/tests/AutoReview/CommandTest.php index 14b61b26566..fcbf2f9617a 100644 --- a/tests/AutoReview/CommandTest.php +++ b/tests/AutoReview/CommandTest.php @@ -38,7 +38,7 @@ public function testCommandHasNameConst(Command $command): void self::assertNotNull($command::getDefaultName()); } - public static function provideCommandHasNameConstCases(): array + public static function provideCommandHasNameConstCases(): iterable { $application = new Application(); $commands = $application->all(); diff --git a/tests/AutoReview/ProjectCodeTest.php b/tests/AutoReview/ProjectCodeTest.php index 580307cf6dc..4da391390ee 100644 --- a/tests/AutoReview/ProjectCodeTest.php +++ b/tests/AutoReview/ProjectCodeTest.php @@ -581,7 +581,7 @@ static function (\ReflectionMethod $rm): string { ); } - public static function provideSrcClassCases(): array + public static function provideSrcClassCases(): iterable { return array_map( static function (string $item): array { @@ -591,7 +591,7 @@ static function (string $item): array { ); } - public static function provideThatSrcClassesNotAbuseInterfacesCases(): array + public static function provideThatSrcClassesNotAbuseInterfacesCases(): iterable { return array_map( static function (string $item): array { @@ -637,7 +637,7 @@ static function (string $item): array { ); } - public static function provideThatSrcClassHaveTestClassCases(): array + public static function provideThatSrcClassHaveTestClassCases(): iterable { return array_map( static fn (string $item): array => [$item], @@ -667,7 +667,7 @@ public static function provideTestClassCases(): iterable yield from self::$testClassCases; } - public static function provideThereIsNoPregFunctionUsedDirectlyCases(): array + public static function provideThereIsNoPregFunctionUsedDirectlyCases(): iterable { return array_map( static fn (string $item): array => [$item], diff --git a/tests/AutoReview/TransformerTest.php b/tests/AutoReview/TransformerTest.php index c347d875249..b0c2eda8126 100644 --- a/tests/AutoReview/TransformerTest.php +++ b/tests/AutoReview/TransformerTest.php @@ -70,7 +70,7 @@ public function testTransformerPriorityIsListed(TransformerInterface $transforme self::fail(sprintf('Transformer "%s" has priority %d but is not in priority test list.', $name, $priority)); } - public static function provideTransformerPriorityCases(): array + public static function provideTransformerPriorityCases(): iterable { $transformers = []; @@ -102,7 +102,7 @@ public static function provideTransformerPriorityCases(): array /** * @return TransformerInterface[] */ - public static function provideTransformerPriorityIsListedCases(): array + public static function provideTransformerPriorityIsListedCases(): iterable { static $transformersArray = null; diff --git a/tests/Cache/CacheTest.php b/tests/Cache/CacheTest.php index 8226cf6fbe6..2e21a61cbd4 100644 --- a/tests/Cache/CacheTest.php +++ b/tests/Cache/CacheTest.php @@ -119,7 +119,7 @@ public function testFromJsonThrowsInvalidArgumentExceptionIfJsonIsMissingKey(arr Cache::fromJson($json); } - public static function provideFromJsonThrowsInvalidArgumentExceptionIfJsonIsMissingKeyCases(): array + public static function provideFromJsonThrowsInvalidArgumentExceptionIfJsonIsMissingKeyCases(): iterable { $data = [ 'php' => '7.1.2', @@ -158,7 +158,7 @@ public function testCanConvertToAndFromJson(SignatureInterface $signature): void self::assertSame($hash, $cached->get($file)); } - public static function provideCanConvertToAndFromJsonCases(): array + public static function provideCanConvertToAndFromJsonCases(): iterable { $toolInfo = new ToolInfo(); $config = new Config(); diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index d9c2bb4b6bd..fce6e9ae033 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -248,7 +248,7 @@ public function testConfigDefault(): void self::assertFalse($config->getUsingCache()); } - public static function provideRegisterCustomFixersCases(): array + public static function provideRegisterCustomFixersCases(): iterable { $fixers = [ new NoWhitespaceBeforeCommaInArrayFixer(), diff --git a/tests/Console/Command/FixCommandExitStatusCalculatorTest.php b/tests/Console/Command/FixCommandExitStatusCalculatorTest.php index 4b49e3e17ea..9dafffbf420 100644 --- a/tests/Console/Command/FixCommandExitStatusCalculatorTest.php +++ b/tests/Console/Command/FixCommandExitStatusCalculatorTest.php @@ -40,7 +40,7 @@ public function testCalculate(int $expected, bool $isDryRun, bool $hasChangedFil ); } - public static function provideCalculateCases(): array + public static function provideCalculateCases(): iterable { return [ [0, true, false, false, false, false], diff --git a/tests/Console/Command/SelfUpdateCommandTest.php b/tests/Console/Command/SelfUpdateCommandTest.php index 973b0e1fabd..c6a730fcb66 100644 --- a/tests/Console/Command/SelfUpdateCommandTest.php +++ b/tests/Console/Command/SelfUpdateCommandTest.php @@ -81,7 +81,7 @@ public function testCommandName(string $name): void self::assertSame($command, $application->find($name)); } - public static function provideCommandNameCases(): array + public static function provideCommandNameCases(): iterable { return [ ['self-update'], @@ -135,7 +135,7 @@ public function testExecute( self::assertSame(0, $commandTester->getStatusCode()); } - public static function provideExecuteCases(): array + public static function provideExecuteCases(): iterable { $currentVersion = Application::VERSION; $minorRelease = self::getNewMinorReleaseVersion(); @@ -276,7 +276,7 @@ public function testExecuteWhenNotAbleToGetLatestVersions( self::assertSame(1, $commandTester->getStatusCode()); } - public static function provideExecuteWhenNotAbleToGetLatestVersionsCases(): array + public static function provideExecuteWhenNotAbleToGetLatestVersionsCases(): iterable { return [ [false, false, [], true], @@ -322,7 +322,7 @@ public function testExecuteWhenNotInstalledAsPhar(array $input, bool $decorated) self::assertSame(1, $commandTester->getStatusCode()); } - public static function provideExecuteWhenNotInstalledAsPharCases(): array + public static function provideExecuteWhenNotInstalledAsPharCases(): iterable { return [ [[], true], diff --git a/tests/Console/ConfigurationResolverTest.php b/tests/Console/ConfigurationResolverTest.php index 7593410e124..1d290b0b9cc 100644 --- a/tests/Console/ConfigurationResolverTest.php +++ b/tests/Console/ConfigurationResolverTest.php @@ -130,7 +130,7 @@ public function testResolveProgressWithNegativeConfigAndExplicitProgress(string self::assertSame($progressType, $resolver->getProgress()); } - public static function provideProgressTypeCases(): array + public static function provideProgressTypeCases(): iterable { return [ ['none'], @@ -195,7 +195,7 @@ public function testResolveConfigFileChooseFile(string $expectedFile, string $ex self::assertInstanceOf($expectedClass, $resolver->getConfig()); } - public static function provideResolveConfigFileChooseFileCases(): array + public static function provideResolveConfigFileChooseFileCases(): iterable { $dirBase = self::getFixtureDir(); @@ -498,7 +498,7 @@ static function (\SplFileInfo $file): string { self::assertSame($expected, $intersectionItems); } - public static function provideResolveIntersectionOfPathsCases(): array + public static function provideResolveIntersectionOfPathsCases(): iterable { $dir = __DIR__.'/../Fixtures/ConfigurationResolverPathsIntersection'; $cb = static function (array $items) use ($dir): array { @@ -666,7 +666,7 @@ public function testConfigFinderIsOverridden(array $options, bool $expectedResul self::assertSame($expectedResult, $resolver->configFinderIsOverridden()); } - public static function provideConfigFinderIsOverriddenCases(): array + public static function provideConfigFinderIsOverriddenCases(): iterable { $root = __DIR__.'/../..'; @@ -1080,7 +1080,7 @@ public function testResolveDiffer(string $expected, $diffConfig): void self::assertInstanceOf($expected, $resolver->getDiffer()); } - public static function provideResolveDifferCases(): array + public static function provideResolveDifferCases(): iterable { return [ [ @@ -1121,7 +1121,7 @@ public function testDeprecationOfPassingOtherThanNoOrYes(): void $resolver->getRiskyAllowed(); } - public static function provideResolveBooleanOptionCases(): array + public static function provideResolveBooleanOptionCases(): iterable { return [ [true, true, 'yes'], @@ -1162,7 +1162,7 @@ public function testDeprecatedFixerConfigured($ruleConfig): void $resolver->getFixers(); } - public static function provideDeprecatedFixerConfiguredCases(): array + public static function provideDeprecatedFixerConfiguredCases(): iterable { return [ [true], @@ -1171,7 +1171,7 @@ public static function provideDeprecatedFixerConfiguredCases(): array ]; } - public static function provideGetDirectoryCases(): array + public static function provideGetDirectoryCases(): iterable { return [ [null, '/my/path/my/file', 'my/file'], diff --git a/tests/Console/Output/ErrorOutputTest.php b/tests/Console/Output/ErrorOutputTest.php index b1a268cb28d..69cf938cd72 100644 --- a/tests/Console/Output/ErrorOutputTest.php +++ b/tests/Console/Output/ErrorOutputTest.php @@ -81,7 +81,7 @@ public function testErrorOutput(Error $error, int $verbosityLevel, int $lineNumb self::assertStringStartsWith($startWith, $displayed); } - public static function provideErrorOutputCases(): array + public static function provideErrorOutputCases(): iterable { $lineNumber = __LINE__; [$exceptionLineNumber, $error] = self::getErrorAndLineNumber(); // note: keep call and __LINE__ separated with one line break diff --git a/tests/Console/Output/ProcessOutputTest.php b/tests/Console/Output/ProcessOutputTest.php index 927beb41f25..1b6dee2b4cd 100644 --- a/tests/Console/Output/ProcessOutputTest.php +++ b/tests/Console/Output/ProcessOutputTest.php @@ -55,7 +55,7 @@ public function testProcessProgressOutput(array $statuses, string $expectedOutpu self::assertSame($expectedOutput, $output->fetch()); } - public static function provideProcessProgressOutputCases(): array + public static function provideProcessProgressOutputCases(): iterable { return [ [ diff --git a/tests/Console/Report/FixReport/AbstractReporterTestCase.php b/tests/Console/Report/FixReport/AbstractReporterTestCase.php index aa43b1abf0d..68bdc4f7370 100644 --- a/tests/Console/Report/FixReport/AbstractReporterTestCase.php +++ b/tests/Console/Report/FixReport/AbstractReporterTestCase.php @@ -62,7 +62,7 @@ final public function testGenerate(string $expectedReport, ReportSummary $report $this->assertFormat($expectedReport, $actualReport); } - final public static function provideGenerateCases(): array + final public static function provideGenerateCases(): iterable { return [ 'no errors' => [ diff --git a/tests/Console/SelfUpdate/NewVersionCheckerTest.php b/tests/Console/SelfUpdate/NewVersionCheckerTest.php index aa800ceab31..5df83107dc5 100644 --- a/tests/Console/SelfUpdate/NewVersionCheckerTest.php +++ b/tests/Console/SelfUpdate/NewVersionCheckerTest.php @@ -42,7 +42,7 @@ public function testGetLatestVersionOfMajor(int $majorVersion, ?string $expected self::assertSame($expectedVersion, $checker->getLatestVersionOfMajor($majorVersion)); } - public static function provideGetLatestVersionOfMajorCases(): array + public static function provideGetLatestVersionOfMajorCases(): iterable { return [ [1, 'v1.13.2'], @@ -68,7 +68,7 @@ public function testCompareVersions(string $versionA, string $versionB, int $exp ); } - public static function provideCompareVersionsCases(): array + public static function provideCompareVersionsCases(): iterable { $cases = []; diff --git a/tests/Differ/DiffConsoleFormatterTest.php b/tests/Differ/DiffConsoleFormatterTest.php index 558444b41c8..c5f15e735eb 100644 --- a/tests/Differ/DiffConsoleFormatterTest.php +++ b/tests/Differ/DiffConsoleFormatterTest.php @@ -38,7 +38,7 @@ public function testDiffConsoleFormatter(string $expected, bool $isDecoratedOutp ); } - public static function provideDiffConsoleFormatterCases(): array + public static function provideDiffConsoleFormatterCases(): iterable { return [ [ diff --git a/tests/DocBlock/AnnotationTest.php b/tests/DocBlock/AnnotationTest.php index fbdccd493a2..e81358dac9c 100644 --- a/tests/DocBlock/AnnotationTest.php +++ b/tests/DocBlock/AnnotationTest.php @@ -193,7 +193,7 @@ public function testRemoveEdgeCases(string $expected, string $input): void self::assertSame($expected, $doc->getContent()); } - public static function provideRemoveEdgeCasesCases(): array + public static function provideRemoveEdgeCasesCases(): iterable { return [ // Single line @@ -242,7 +242,7 @@ public function testTypeParsing(array $expected, string $input): void self::assertSame($expected, $tag->getTypes()); } - public static function provideTypeParsingCases(): array + public static function provideTypeParsingCases(): iterable { return [ [ @@ -468,7 +468,7 @@ public function testTypes(array $expected, array $new, string $input, string $ou self::assertSame($output, $line->getContent()); } - public static function provideTypesCases(): array + public static function provideTypesCases(): iterable { return [ [['Foo', 'null'], ['Bar[]'], ' * @param Foo|null $foo', ' * @param Bar[] $foo'], @@ -494,7 +494,7 @@ public function testNormalizedTypes(array $expected, string $input): void self::assertSame($expected, $tag->getNormalizedTypes()); } - public static function provideNormalizedTypesCases(): array + public static function provideNormalizedTypesCases(): iterable { return [ [['null', 'string'], '* @param StRiNg|NuLl $foo'], diff --git a/tests/DocBlock/DocBlockTest.php b/tests/DocBlock/DocBlockTest.php index 8743f268b64..1af1cbf54f9 100644 --- a/tests/DocBlock/DocBlockTest.php +++ b/tests/DocBlock/DocBlockTest.php @@ -170,7 +170,7 @@ public function testMakeMultiLIne(string $inputDocBlock, string $outputDocBlock self::assertSame($outputDocBlock, $doc->getContent()); } - public static function provideMakeMultiLIneCases(): array + public static function provideMakeMultiLIneCases(): iterable { return [ 'It keeps a multi line doc block as is' => [ @@ -215,7 +215,7 @@ public function testMakeSingleLine(string $inputDocBlock, string $outputDocBlock self::assertSame($outputDocBlock, $doc->getContent()); } - public static function provideMakeSingleLineCases(): array + public static function provideMakeSingleLineCases(): iterable { return [ 'It keeps a single line doc block as is' => [ diff --git a/tests/DocBlock/ShortDescriptionTest.php b/tests/DocBlock/ShortDescriptionTest.php index 6df456946cf..fa27664cec8 100644 --- a/tests/DocBlock/ShortDescriptionTest.php +++ b/tests/DocBlock/ShortDescriptionTest.php @@ -36,7 +36,7 @@ public function testGetEnd(?int $expected, string $input): void self::assertSame($expected, $shortDescription->getEnd()); } - public static function provideGetEndCases(): array + public static function provideGetEndCases(): iterable { return [ [1, '/** diff --git a/tests/DocBlock/TagComparatorTest.php b/tests/DocBlock/TagComparatorTest.php index b1037013461..8356ad21e0d 100644 --- a/tests/DocBlock/TagComparatorTest.php +++ b/tests/DocBlock/TagComparatorTest.php @@ -44,7 +44,7 @@ public function testComparatorTogether(string $first, string $second, bool $expe self::assertSame($expected, TagComparator::shouldBeTogether($tag1, $tag2)); } - public static function provideComparatorTogetherCases(): array + public static function provideComparatorTogetherCases(): iterable { return [ ['return', 'return', true], @@ -79,7 +79,7 @@ public function testComparatorTogetherWithDefinedGroups(array $groups, string $f ); } - public static function provideComparatorTogetherWithDefinedGroupsCases(): array + public static function provideComparatorTogetherWithDefinedGroupsCases(): iterable { return [ [[['param', 'return']], 'return', 'return', true], diff --git a/tests/DocBlock/TagTest.php b/tests/DocBlock/TagTest.php index 5030e602b36..1e180cd9090 100644 --- a/tests/DocBlock/TagTest.php +++ b/tests/DocBlock/TagTest.php @@ -46,7 +46,7 @@ public function testName(string $expected, string $new, string $input): void self::assertSame($new, $tag->getName()); } - public static function provideNameCases(): array + public static function provideNameCases(): iterable { return [ ['param', 'var', ' * @param Foo $foo'], @@ -72,7 +72,7 @@ public function testValid(bool $expected, string $input): void self::assertSame($expected, $tag->valid()); } - public static function provideValidCases(): array + public static function provideValidCases(): iterable { return [ [true, ' * @param Foo $foo'], diff --git a/tests/Doctrine/Annotation/TokenTest.php b/tests/Doctrine/Annotation/TokenTest.php index bc2eb3b8bd5..00e5e2e1574 100644 --- a/tests/Doctrine/Annotation/TokenTest.php +++ b/tests/Doctrine/Annotation/TokenTest.php @@ -74,7 +74,7 @@ public function testIsTypeReturnsTrue(int $type, $types): void self::assertTrue($token->isType($types)); } - public static function provideIsTypeReturnsTrueCases(): array + public static function provideIsTypeReturnsTrueCases(): iterable { return [ 'same-value' => [ @@ -105,7 +105,7 @@ public function testIsTypeReturnsFalse(int $type, $types): void self::assertFalse($token->isType($types)); } - public static function provideIsTypeReturnsFalseCases(): array + public static function provideIsTypeReturnsFalseCases(): iterable { return [ 'different-value' => [ diff --git a/tests/Fixer/Alias/BacktickToShellExecFixerTest.php b/tests/Fixer/Alias/BacktickToShellExecFixerTest.php index b9b104cf0d4..0642b9c86fe 100644 --- a/tests/Fixer/Alias/BacktickToShellExecFixerTest.php +++ b/tests/Fixer/Alias/BacktickToShellExecFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'plain' => [ diff --git a/tests/Fixer/Alias/MbStrFunctionsFixerTest.php b/tests/Fixer/Alias/MbStrFunctionsFixerTest.php index 84ca3591151..104233ea812 100644 --- a/tests/Fixer/Alias/MbStrFunctionsFixerTest.php +++ b/tests/Fixer/Alias/MbStrFunctionsFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Alias/NoMixedEchoPrintFixerTest.php b/tests/Fixer/Alias/NoMixedEchoPrintFixerTest.php index 0eefadb97a8..cdfca5294ea 100644 --- a/tests/Fixer/Alias/NoMixedEchoPrintFixerTest.php +++ b/tests/Fixer/Alias/NoMixedEchoPrintFixerTest.php @@ -294,7 +294,7 @@ public function testWrongConfig(array $wrongConfig, string $expectedMessage): vo $this->fixer->configure($wrongConfig); } - public static function provideWrongConfigCases(): array + public static function provideWrongConfigCases(): iterable { return [ [ diff --git a/tests/Fixer/Alias/PowToExponentiationFixerTest.php b/tests/Fixer/Alias/PowToExponentiationFixerTest.php index 97a7a9e6e50..4062739501f 100644 --- a/tests/Fixer/Alias/PowToExponentiationFixerTest.php +++ b/tests/Fixer/Alias/PowToExponentiationFixerTest.php @@ -263,7 +263,7 @@ public function testNotFix(string $expected): void $this->doTest($expected); } - public static function provideNotFixCases(): array + public static function provideNotFixCases(): iterable { return [ [ @@ -291,7 +291,7 @@ public function testFix80(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFix80Cases(): array + public static function provideFix80Cases(): iterable { return [ [ diff --git a/tests/Fixer/Alias/RandomApiMigrationFixerTest.php b/tests/Fixer/Alias/RandomApiMigrationFixerTest.php index c189ad206af..6b0b50b892b 100644 --- a/tests/Fixer/Alias/RandomApiMigrationFixerTest.php +++ b/tests/Fixer/Alias/RandomApiMigrationFixerTest.php @@ -72,7 +72,7 @@ public function testFix(string $expected, ?string $input = null, array $config = /** * @return array[] */ - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Alias/SetTypeToCastFixerTest.php b/tests/Fixer/Alias/SetTypeToCastFixerTest.php index f1fc3147e69..e3ca78f54ed 100644 --- a/tests/Fixer/Alias/SetTypeToCastFixerTest.php +++ b/tests/Fixer/Alias/SetTypeToCastFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'null cast' => [ diff --git a/tests/Fixer/ArrayNotation/ArraySyntaxFixerTest.php b/tests/Fixer/ArrayNotation/ArraySyntaxFixerTest.php index 04757d29035..3f19f793736 100644 --- a/tests/Fixer/ArrayNotation/ArraySyntaxFixerTest.php +++ b/tests/Fixer/ArrayNotation/ArraySyntaxFixerTest.php @@ -53,7 +53,7 @@ public function testFixLongSyntax(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixLongSyntaxCases(): array + public static function provideFixLongSyntaxCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixShortSyntaxCases(): array + public static function provideFixShortSyntaxCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixerTest.php b/tests/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixerTest.php index 14c5348c540..61e0cff9761 100644 --- a/tests/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixerTest.php +++ b/tests/Fixer/ArrayNotation/NoTrailingCommaInSinglelineArrayFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ // old style array diff --git a/tests/Fixer/ArrayNotation/NormalizeIndexBraceFixerTest.php b/tests/Fixer/ArrayNotation/NormalizeIndexBraceFixerTest.php index a923501b4b0..4c8e09ee746 100644 --- a/tests/Fixer/ArrayNotation/NormalizeIndexBraceFixerTest.php +++ b/tests/Fixer/ArrayNotation/NormalizeIndexBraceFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ArrayNotation/TrimArraySpacesFixerTest.php b/tests/Fixer/ArrayNotation/TrimArraySpacesFixerTest.php index 45a92c31873..7ada4fca275 100644 --- a/tests/Fixer/ArrayNotation/TrimArraySpacesFixerTest.php +++ b/tests/Fixer/ArrayNotation/TrimArraySpacesFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixerTest.php b/tests/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixerTest.php index 2887e8eff0a..75de2937749 100644 --- a/tests/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixerTest.php +++ b/tests/Fixer/ArrayNotation/WhitespaceAfterCommaInArrayFixerTest.php @@ -39,7 +39,7 @@ public function testFix(string $expected, ?string $input = null, ?array $configu $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ // old style array diff --git a/tests/Fixer/Basic/NoTrailingCommaInSinglelineFixerTest.php b/tests/Fixer/Basic/NoTrailingCommaInSinglelineFixerTest.php index 2adbb3505a2..ad971ecb91a 100644 --- a/tests/Fixer/Basic/NoTrailingCommaInSinglelineFixerTest.php +++ b/tests/Fixer/Basic/NoTrailingCommaInSinglelineFixerTest.php @@ -274,7 +274,7 @@ public function testFixNoTrailingCommaInSinglelineArrayFixer(string $expected, ? $this->doTest($expected, $input); } - public static function provideFixNoTrailingCommaInSinglelineArrayFixerCases(): array + public static function provideFixNoTrailingCommaInSinglelineArrayFixerCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -134,7 +134,7 @@ public function testFixWithEscapeSequencesInStrings(string $expected, ?string $i $this->doTest($expected, $input); } - public static function provideFixWithEscapeSequencesInStringsCases(): array + public static function provideFixWithEscapeSequencesInStringsCases(): iterable { return [ [ diff --git a/tests/Fixer/Basic/PsrAutoloadingFixerTest.php b/tests/Fixer/Basic/PsrAutoloadingFixerTest.php index bcfa14e9899..50fc76ee6a2 100644 --- a/tests/Fixer/Basic/PsrAutoloadingFixerTest.php +++ b/tests/Fixer/Basic/PsrAutoloadingFixerTest.php @@ -365,7 +365,7 @@ class PsrAutoloadingFixer {} ]; } - public static function provideIgnoredCases(): array + public static function provideIgnoredCases(): iterable { $cases = ['.php', 'Foo.class.php', '4Foo.php', '$#.php']; diff --git a/tests/Fixer/Casing/ConstantCaseFixerTest.php b/tests/Fixer/Casing/ConstantCaseFixerTest.php index b4fb2a91643..181b87f6d42 100644 --- a/tests/Fixer/Casing/ConstantCaseFixerTest.php +++ b/tests/Fixer/Casing/ConstantCaseFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Casing/LowercaseKeywordsFixerTest.php b/tests/Fixer/Casing/LowercaseKeywordsFixerTest.php index 2684785d5f7..7bc6ab51277 100644 --- a/tests/Fixer/Casing/LowercaseKeywordsFixerTest.php +++ b/tests/Fixer/Casing/LowercaseKeywordsFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Casing/MagicConstantCasingFixerTest.php b/tests/Fixer/Casing/MagicConstantCasingFixerTest.php index 0618e1f21d0..73b4a4d2c0f 100644 --- a/tests/Fixer/Casing/MagicConstantCasingFixerTest.php +++ b/tests/Fixer/Casing/MagicConstantCasingFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -93,7 +93,7 @@ public function testFix74(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFix74Cases(): array + public static function provideFix74Cases(): iterable { return [ [ diff --git a/tests/Fixer/Casing/MagicMethodCasingFixerTest.php b/tests/Fixer/Casing/MagicMethodCasingFixerTest.php index 94a7e4f2ef4..41a5fefa6a0 100644 --- a/tests/Fixer/Casing/MagicMethodCasingFixerTest.php +++ b/tests/Fixer/Casing/MagicMethodCasingFixerTest.php @@ -273,7 +273,7 @@ public function testDoNotFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideDoNotFixCases(): array + public static function provideDoNotFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Casing/NativeFunctionCasingFixerTest.php b/tests/Fixer/Casing/NativeFunctionCasingFixerTest.php index c51f8bf0830..be9ced466e0 100644 --- a/tests/Fixer/Casing/NativeFunctionCasingFixerTest.php +++ b/tests/Fixer/Casing/NativeFunctionCasingFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixerTest.php b/tests/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixerTest.php index 6b2ac03ba50..743bcb36eb0 100644 --- a/tests/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixerTest.php +++ b/tests/Fixer/Casing/NativeFunctionTypeDeclarationCasingFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/CastNotation/CastSpacesFixerTest.php b/tests/Fixer/CastNotation/CastSpacesFixerTest.php index 46a15f88143..9941fdab165 100644 --- a/tests/Fixer/CastNotation/CastSpacesFixerTest.php +++ b/tests/Fixer/CastNotation/CastSpacesFixerTest.php @@ -57,7 +57,7 @@ public function testFixCastsSingleSpace(string $expected, ?string $input = null) $this->doTest($expected, $input); } - public static function provideFixCastsCases(): array + public static function provideFixCastsCases(): iterable { return [ [ @@ -121,7 +121,7 @@ public function testFixCastsNoneSpace(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixCastsNoneSpaceCases(): array + public static function provideFixCastsNoneSpaceCases(): iterable { return [ [ diff --git a/tests/Fixer/CastNotation/NoShortBoolCastFixerTest.php b/tests/Fixer/CastNotation/NoShortBoolCastFixerTest.php index 2184370ecfa..957ac1b8d9b 100644 --- a/tests/Fixer/CastNotation/NoShortBoolCastFixerTest.php +++ b/tests/Fixer/CastNotation/NoShortBoolCastFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/CastNotation/NoUnsetCastFixerTest.php b/tests/Fixer/CastNotation/NoUnsetCastFixerTest.php index 56445d4b9d9..53b4fd073e4 100644 --- a/tests/Fixer/CastNotation/NoUnsetCastFixerTest.php +++ b/tests/Fixer/CastNotation/NoUnsetCastFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'simple form I' => [ diff --git a/tests/Fixer/CastNotation/ShortScalarCastFixerTest.php b/tests/Fixer/CastNotation/ShortScalarCastFixerTest.php index 46d7fe0161b..105d454f61a 100644 --- a/tests/Fixer/CastNotation/ShortScalarCastFixerTest.php +++ b/tests/Fixer/CastNotation/ShortScalarCastFixerTest.php @@ -67,7 +67,7 @@ public function testNoFix(string $expected): void $this->doTest($expected); } - public static function provideNoFixCases(): array + public static function provideNoFixCases(): iterable { $cases = []; $types = ['string', 'array', 'object']; diff --git a/tests/Fixer/ClassNotation/ClassAttributesSeparationFixerTest.php b/tests/Fixer/ClassNotation/ClassAttributesSeparationFixerTest.php index 25c62f93d30..7bdaf0feab9 100644 --- a/tests/Fixer/ClassNotation/ClassAttributesSeparationFixerTest.php +++ b/tests/Fixer/ClassNotation/ClassAttributesSeparationFixerTest.php @@ -286,7 +286,7 @@ public function testCommentBlockStartDetection(int $expected, string $code, int ); } - public static function provideCommentBlockStartDetectionCases(): array + public static function provideCommentBlockStartDetectionCases(): iterable { return [ [ @@ -371,7 +371,7 @@ public function testFixClasses(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixClassesCases(): array + public static function provideFixClassesCases(): iterable { $cases = []; @@ -969,7 +969,7 @@ public function testFixTraits(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixTraitsCases(): array + public static function provideFixTraitsCases(): iterable { $cases = []; @@ -1063,7 +1063,7 @@ public function testFixInterface(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixInterfaceCases(): array + public static function provideFixInterfaceCases(): iterable { $cases = []; $cases[] = [ @@ -1148,7 +1148,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ @@ -1173,7 +1173,7 @@ public function testWithConfig(string $expected, ?string $input, array $config): $this->doTest($expected, $input); } - public static function provideWithConfigCases(): array + public static function provideWithConfigCases(): iterable { return [ 'multi line property' => [ @@ -1799,7 +1799,7 @@ public function testFix71(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFix71Cases(): array + public static function provideFix71Cases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/ClassDefinitionFixerTest.php b/tests/Fixer/ClassNotation/ClassDefinitionFixerTest.php index b6dfb26bdf6..b19e3baad82 100644 --- a/tests/Fixer/ClassNotation/ClassDefinitionFixerTest.php +++ b/tests/Fixer/ClassNotation/ClassDefinitionFixerTest.php @@ -118,7 +118,7 @@ public function testInvalidConfigurationValueType(): void $fixer->configure(['single_line' => 'z']); } - public static function provideFixingAnonymousClassesCases(): array + public static function provideFixingAnonymousClassesCases(): iterable { return [ [ @@ -315,7 +315,7 @@ class# ]; } - public static function provideFixingClassesCases(): array + public static function provideFixingClassesCases(): iterable { return array_merge( self::provideClassyCases('class'), @@ -324,7 +324,7 @@ public static function provideFixingClassesCases(): array ); } - public static function provideFixingClassesWithConfigCases(): array + public static function provideFixingClassesWithConfigCases(): iterable { return [ [ @@ -374,7 +374,7 @@ public static function provideFixingClassesWithConfigCases(): array ]; } - public static function provideFixingInterfacesCases(): array + public static function provideFixingInterfacesCases(): iterable { $cases = array_merge( self::provideClassyCases('interface'), @@ -411,7 +411,7 @@ interface Test return $cases; } - public static function provideFixingTraitsCases(): array + public static function provideFixingTraitsCases(): iterable { return self::provideClassyCases('trait'); } @@ -437,7 +437,7 @@ public function testClassyDefinitionInfo(string $source, array $expected): void self::assertSame($expected, $result); } - public static function provideClassyDefinitionInfoCases(): array + public static function provideClassyDefinitionInfoCases(): iterable { return [ [ @@ -646,7 +646,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -704,7 +704,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/FinalClassFixerTest.php b/tests/Fixer/ClassNotation/FinalClassFixerTest.php index e9220e9bdfd..3fdf7f7af41 100644 --- a/tests/Fixer/ClassNotation/FinalClassFixerTest.php +++ b/tests/Fixer/ClassNotation/FinalClassFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFix80Cases(): array + public static function provideFix80Cases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFix82Cases(): array + public static function provideFix82Cases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $input = $expected = 'doTest($expected, $input); } - public static function provideFixWithConfigCases(): array + public static function provideFixWithConfigCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixerTest.php b/tests/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixerTest.php index f14a7c20b51..6b9c3f0edfd 100644 --- a/tests/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixerTest.php +++ b/tests/Fixer/ClassNotation/FinalPublicMethodForAbstractClassFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $original = $fixed = self::getClassElementStubs(); $fixed = str_replace('public function f1', 'final public function f1', $fixed); diff --git a/tests/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixerTest.php b/tests/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixerTest.php index 028c9935ff7..1314543db9b 100644 --- a/tests/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixerTest.php +++ b/tests/Fixer/ClassNotation/NoBlankLinesAfterClassOpeningFixerTest.php @@ -42,7 +42,7 @@ public function testFixTraits(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $cases = []; @@ -164,7 +164,7 @@ function bar() {} return $cases; } - public static function provideFixTraitsCases(): array + public static function provideFixTraitsCases(): iterable { $cases = []; @@ -201,7 +201,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/NoNullPropertyInitializationFixerTest.php b/tests/Fixer/ClassNotation/NoNullPropertyInitializationFixerTest.php index 03c248d1e38..e8a848e64c2 100644 --- a/tests/Fixer/ClassNotation/NoNullPropertyInitializationFixerTest.php +++ b/tests/Fixer/ClassNotation/NoNullPropertyInitializationFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/NoPhp4ConstructorFixerTest.php b/tests/Fixer/ClassNotation/NoPhp4ConstructorFixerTest.php index 0ed7e5259a7..3341a2c595f 100644 --- a/tests/Fixer/ClassNotation/NoPhp4ConstructorFixerTest.php +++ b/tests/Fixer/ClassNotation/NoPhp4ConstructorFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -71,7 +71,7 @@ public function testSimpleClass(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideSimpleClassCases(): array + public static function provideSimpleClassCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/NoUnneededFinalMethodFixerTest.php b/tests/Fixer/ClassNotation/NoUnneededFinalMethodFixerTest.php index 7d2f14591c9..43971403dab 100644 --- a/tests/Fixer/ClassNotation/NoUnneededFinalMethodFixerTest.php +++ b/tests/Fixer/ClassNotation/NoUnneededFinalMethodFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'default' => [ diff --git a/tests/Fixer/ClassNotation/OrderedClassElementsFixerTest.php b/tests/Fixer/ClassNotation/OrderedClassElementsFixerTest.php index 2fbc27cdfae..7530b084d18 100644 --- a/tests/Fixer/ClassNotation/OrderedClassElementsFixerTest.php +++ b/tests/Fixer/ClassNotation/OrderedClassElementsFixerTest.php @@ -396,7 +396,7 @@ public function testFixWithConfiguration(array $configuration, string $expected, $this->doTest($expected, $input); } - public static function provideFixWithConfigurationCases(): array + public static function provideFixWithConfigurationCases(): iterable { return [ [ @@ -1041,7 +1041,7 @@ public function testFixWithSortingAlgorithm(array $configuration, string $expect $this->doTest($expected, $input); } - public static function provideFixWithSortingAlgorithmCases(): array + public static function provideFixWithSortingAlgorithmCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/OrderedInterfacesFixerTest.php b/tests/Fixer/ClassNotation/OrderedInterfacesFixerTest.php index b645fe98042..66f72a0d1f7 100644 --- a/tests/Fixer/ClassNotation/OrderedInterfacesFixerTest.php +++ b/tests/Fixer/ClassNotation/OrderedInterfacesFixerTest.php @@ -34,7 +34,7 @@ public function testFixAlpha(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixAlphaCases(): array + public static function provideFixAlphaCases(): iterable { return [ 'single' => [ @@ -128,7 +128,7 @@ public function testFixAlphaDescend(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixAlphaDescendCases(): array + public static function provideFixAlphaDescendCases(): iterable { return [ 'single' => [ @@ -154,7 +154,7 @@ public function testFixLength(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixLengthCases(): array + public static function provideFixLengthCases(): iterable { return [ 'single' => [ @@ -197,7 +197,7 @@ public function testFixLengthDescend(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixLengthDescendCases(): array + public static function provideFixLengthDescendCases(): iterable { return [ 'single' => [ diff --git a/tests/Fixer/ClassNotation/ProtectedToPrivateFixerTest.php b/tests/Fixer/ClassNotation/ProtectedToPrivateFixerTest.php index 352a1f9bd14..7754d1d710c 100644 --- a/tests/Fixer/ClassNotation/ProtectedToPrivateFixerTest.php +++ b/tests/Fixer/ClassNotation/ProtectedToPrivateFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $attributesAndMethodsOriginal = self::getAttributesAndMethods(true); $attributesAndMethodsFixed = self::getAttributesAndMethods(false); diff --git a/tests/Fixer/ClassNotation/SelfAccessorFixerTest.php b/tests/Fixer/ClassNotation/SelfAccessorFixerTest.php index f8d4b92b8c5..bdd99c6fa46 100644 --- a/tests/Fixer/ClassNotation/SelfAccessorFixerTest.php +++ b/tests/Fixer/ClassNotation/SelfAccessorFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/SelfStaticAccessorFixerTest.php b/tests/Fixer/ClassNotation/SelfStaticAccessorFixerTest.php index cc705f7b57b..3a6c13e3663 100644 --- a/tests/Fixer/ClassNotation/SelfStaticAccessorFixerTest.php +++ b/tests/Fixer/ClassNotation/SelfStaticAccessorFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'simple' => [ diff --git a/tests/Fixer/ClassNotation/SingleClassElementPerStatementFixerTest.php b/tests/Fixer/ClassNotation/SingleClassElementPerStatementFixerTest.php index 4a154ca6384..ffa51782722 100644 --- a/tests/Fixer/ClassNotation/SingleClassElementPerStatementFixerTest.php +++ b/tests/Fixer/ClassNotation/SingleClassElementPerStatementFixerTest.php @@ -707,7 +707,7 @@ class Foo $this->doTest($expected, $input); } - public static function provideFixWithConfigurationCases(): array + public static function provideFixWithConfigurationCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassNotation/SingleTraitInsertPerStatementFixerTest.php b/tests/Fixer/ClassNotation/SingleTraitInsertPerStatementFixerTest.php index 82a82cf1c3a..36b8e0bf84b 100644 --- a/tests/Fixer/ClassNotation/SingleTraitInsertPerStatementFixerTest.php +++ b/tests/Fixer/ClassNotation/SingleTraitInsertPerStatementFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'simple' => [ diff --git a/tests/Fixer/ClassNotation/VisibilityRequiredFixerTest.php b/tests/Fixer/ClassNotation/VisibilityRequiredFixerTest.php index 3d0506364e4..3391e053003 100644 --- a/tests/Fixer/ClassNotation/VisibilityRequiredFixerTest.php +++ b/tests/Fixer/ClassNotation/VisibilityRequiredFixerTest.php @@ -526,7 +526,7 @@ public function testFixClassConst(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFixClassConstCases(): array + public static function provideFixClassConstCases(): iterable { return [ [ diff --git a/tests/Fixer/ClassUsage/DateTimeImmutableFixerTest.php b/tests/Fixer/ClassUsage/DateTimeImmutableFixerTest.php index 51d9bbc3b42..d0a426a17d1 100644 --- a/tests/Fixer/ClassUsage/DateTimeImmutableFixerTest.php +++ b/tests/Fixer/ClassUsage/DateTimeImmutableFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Comment/CommentToPhpdocFixerTest.php b/tests/Fixer/Comment/CommentToPhpdocFixerTest.php index 8f8f1064da2..047420ba0c6 100644 --- a/tests/Fixer/Comment/CommentToPhpdocFixerTest.php +++ b/tests/Fixer/Comment/CommentToPhpdocFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Comment/HeaderCommentFixerTest.php b/tests/Fixer/Comment/HeaderCommentFixerTest.php index 53ba19a2286..34f829023e6 100644 --- a/tests/Fixer/Comment/HeaderCommentFixerTest.php +++ b/tests/Fixer/Comment/HeaderCommentFixerTest.php @@ -38,7 +38,7 @@ public function testFix(array $configuration, string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -630,7 +630,7 @@ public function testMisconfiguration(?array $configuration, string $exceptionMes $this->fixer->configure($configuration); } - public static function provideMisconfigurationCases(): array + public static function provideMisconfigurationCases(): iterable { return [ [[], 'Missing required configuration: The required option "header" is missing.'], @@ -689,7 +689,7 @@ public function testHeaderGeneration(string $expected, string $header, string $t ); } - public static function provideHeaderGenerationCases(): array + public static function provideHeaderGenerationCases(): iterable { return [ [ @@ -721,7 +721,7 @@ public function testDoNotTouch(string $expected): void $this->doTest($expected); } - public static function provideDoNotTouchCases(): array + public static function provideDoNotTouchCases(): iterable { return [ ["\ndoTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/Comment/MultilineCommentOpeningClosingFixerTest.php b/tests/Fixer/Comment/MultilineCommentOpeningClosingFixerTest.php index 8867fb60d1b..4b32f52be3f 100644 --- a/tests/Fixer/Comment/MultilineCommentOpeningClosingFixerTest.php +++ b/tests/Fixer/Comment/MultilineCommentOpeningClosingFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ // fix cases @@ -272,7 +272,7 @@ public function testGetCommentBlock(string $source, int $startIndex, int $endInd self::assertSame($isEmpty, $foundIsEmpty, 'Is empty comment block detection failed.'); } - public static function provideGetCommentBlockCases(): array + public static function provideGetCommentBlockCases(): iterable { $cases = [ [ diff --git a/tests/Fixer/Comment/NoTrailingWhitespaceInCommentFixerTest.php b/tests/Fixer/Comment/NoTrailingWhitespaceInCommentFixerTest.php index c527693c4fa..32365e3235f 100644 --- a/tests/Fixer/Comment/NoTrailingWhitespaceInCommentFixerTest.php +++ b/tests/Fixer/Comment/NoTrailingWhitespaceInCommentFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Comment/SingleLineCommentStyleFixerTest.php b/tests/Fixer/Comment/SingleLineCommentStyleFixerTest.php index d9534a8fdd0..046fb07c0a5 100644 --- a/tests/Fixer/Comment/SingleLineCommentStyleFixerTest.php +++ b/tests/Fixer/Comment/SingleLineCommentStyleFixerTest.php @@ -43,7 +43,7 @@ public function testAsterisk(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideAsteriskCases(): array + public static function provideAsteriskCases(): iterable { return [ [ @@ -226,7 +226,7 @@ public function testHash(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideHashCases(): array + public static function provideHashCases(): iterable { return [ [ @@ -295,7 +295,7 @@ public function testAll(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideAllCases(): array + public static function provideAllCases(): iterable { return [ [ diff --git a/tests/Fixer/ConstantNotation/NativeConstantInvocationFixerTest.php b/tests/Fixer/ConstantNotation/NativeConstantInvocationFixerTest.php index a9905068b15..df691b3ca3d 100644 --- a/tests/Fixer/ConstantNotation/NativeConstantInvocationFixerTest.php +++ b/tests/Fixer/ConstantNotation/NativeConstantInvocationFixerTest.php @@ -78,7 +78,7 @@ public function testConfigureRejectsInvalidIncludeConfigurationElement($element) ]); } - public static function provideInvalidConfigurationElementCases(): array + public static function provideInvalidConfigurationElementCases(): iterable { return [ 'null' => [null], @@ -118,7 +118,7 @@ public function testFixWithDefaultConfiguration(string $expected, ?string $input $this->doTest($expected, $input); } - public static function provideFixWithDefaultConfigurationCases(): array + public static function provideFixWithDefaultConfigurationCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixWithConfiguredCustomIncludeCases(): array + public static function provideFixWithConfiguredCustomIncludeCases(): iterable { return [ [ @@ -226,7 +226,7 @@ public function testFixWithConfiguredOnlyInclude(string $expected, ?string $inpu $this->doTest($expected, $input); } - public static function provideFixWithConfiguredOnlyIncludeCases(): array + public static function provideFixWithConfiguredOnlyIncludeCases(): iterable { return [ [ @@ -254,7 +254,7 @@ public function testFixWithConfiguredExclude(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixWithConfiguredExcludeCases(): array + public static function provideFixWithConfiguredExcludeCases(): iterable { return [ [ diff --git a/tests/Fixer/ControlStructure/ElseifFixerTest.php b/tests/Fixer/ControlStructure/ElseifFixerTest.php index 917f03d03ba..5242c593ffc 100644 --- a/tests/Fixer/ControlStructure/ElseifFixerTest.php +++ b/tests/Fixer/ControlStructure/ElseifFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -1062,7 +1062,7 @@ public function testFixWithDifferentCommentText(string $expected, ?string $input $this->doTest($expected, $input); } - public static function provideFixWithDifferentCommentTextCases(): array + public static function provideFixWithDifferentCommentTextCases(): iterable { $cases = self::provideFixCases(); @@ -1202,7 +1202,7 @@ public function testFixWithCommentTextContainingNewLines(string $text): void ]); } - public static function provideFixWithCommentTextContainingNewLinesCases(): array + public static function provideFixWithCommentTextContainingNewLinesCases(): iterable { return [ ["No\nbreak"], diff --git a/tests/Fixer/ControlStructure/NoSuperfluousElseifFixerTest.php b/tests/Fixer/ControlStructure/NoSuperfluousElseifFixerTest.php index e2a4e89439d..b6d7cd152d8 100644 --- a/tests/Fixer/ControlStructure/NoSuperfluousElseifFixerTest.php +++ b/tests/Fixer/ControlStructure/NoSuperfluousElseifFixerTest.php @@ -32,7 +32,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ControlStructure/NoTrailingCommaInListCallFixerTest.php b/tests/Fixer/ControlStructure/NoTrailingCommaInListCallFixerTest.php index ff190eced7f..5fe46779883 100644 --- a/tests/Fixer/ControlStructure/NoTrailingCommaInListCallFixerTest.php +++ b/tests/Fixer/ControlStructure/NoTrailingCommaInListCallFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ControlStructure/NoUnneededControlParenthesesFixerTest.php b/tests/Fixer/ControlStructure/NoUnneededControlParenthesesFixerTest.php index 7183d86f280..87894162c61 100644 --- a/tests/Fixer/ControlStructure/NoUnneededControlParenthesesFixerTest.php +++ b/tests/Fixer/ControlStructure/NoUnneededControlParenthesesFixerTest.php @@ -50,7 +50,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ControlStructure/NoUselessElseFixerTest.php b/tests/Fixer/ControlStructure/NoUselessElseFixerTest.php index fe229ae5235..5b6eb5849b4 100644 --- a/tests/Fixer/ControlStructure/NoUselessElseFixerTest.php +++ b/tests/Fixer/ControlStructure/NoUselessElseFixerTest.php @@ -33,7 +33,7 @@ public function testCloseTag(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideCloseTagCases(): array + public static function provideCloseTagCases(): iterable { return [ [ @@ -133,7 +133,7 @@ public function testFixIfElseIfElse(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixIfElseIfElseCases(): array + public static function provideFixIfElseIfElseCases(): iterable { $expected = 'doTest($expected, $input); } - public static function provideFixNestedIfCases(): array + public static function provideFixNestedIfCases(): iterable { return [ [ @@ -353,7 +353,7 @@ public function testFixEmptyElse(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixEmptyElseCases(): array + public static function provideFixEmptyElseCases(): iterable { return [ [ @@ -663,7 +663,7 @@ public function testBlockDetection(array $expected, string $source, int $index): self::assertSame($expected, $result); } - public static function provideBlockDetectionCases(): array + public static function provideBlockDetectionCases(): iterable { $cases = []; @@ -789,7 +789,7 @@ public function testIsInConditionWithoutBraces(array $indexes, string $input): v } } - public static function provideIsInConditionWithoutBracesCases(): array + public static function provideIsInConditionWithoutBracesCases(): iterable { return [ [ diff --git a/tests/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixerTest.php b/tests/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixerTest.php index 32a2e1a7ea2..e4c51309760 100644 --- a/tests/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixerTest.php +++ b/tests/Fixer/ControlStructure/SwitchCaseSemicolonToColonFixerTest.php @@ -274,7 +274,7 @@ public function testFix80(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFix80Cases(): array + public static function provideFix80Cases(): iterable { return [ 'Simple match' => [ diff --git a/tests/Fixer/ControlStructure/TrailingCommaInMultilineFixerTest.php b/tests/Fixer/ControlStructure/TrailingCommaInMultilineFixerTest.php index 8ffe2b642c2..f9caa7fdb39 100644 --- a/tests/Fixer/ControlStructure/TrailingCommaInMultilineFixerTest.php +++ b/tests/Fixer/ControlStructure/TrailingCommaInMultilineFixerTest.php @@ -64,7 +64,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ // long syntax tests diff --git a/tests/Fixer/ControlStructure/YodaStyleFixerTest.php b/tests/Fixer/ControlStructure/YodaStyleFixerTest.php index ca970c42da6..554b592e05b 100644 --- a/tests/Fixer/ControlStructure/YodaStyleFixerTest.php +++ b/tests/Fixer/ControlStructure/YodaStyleFixerTest.php @@ -748,7 +748,7 @@ public function testFixLessGreaterInverse(string $expected, string $input): void $this->doTest($input, $expected); } - public static function provideLessGreaterCases(): array + public static function provideLessGreaterCases(): iterable { return [ [ @@ -801,7 +801,7 @@ public function testInvalidConfig(array $config, string $expectedMessage): void $this->fixer->configure($config); } - public static function provideInvalidConfigCases(): array + public static function provideInvalidConfigCases(): iterable { return [ [['equal' => 2], 'Invalid configuration: The option "equal" with value 2 is expected to be of type "bool" or "null", but is of type "(int|integer)"\.'], @@ -839,7 +839,7 @@ public function testPHP71Inverse(string $expected, ?string $input = null): void } } - public static function providePHP71Cases(): array + public static function providePHP71Cases(): iterable { return [ // no fix cases diff --git a/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixerTest.php b/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixerTest.php index c5a8f18116a..2f74678a158 100644 --- a/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixerTest.php +++ b/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationIndentationFixerTest.php @@ -43,7 +43,7 @@ public function testFixWithUnindentedMixedLines(string $expected, ?string $input $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $cases = self::createTestCases([ [' @@ -362,7 +362,7 @@ public function testFixWithIndentedMixedLines(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixWithIndentedMixedLinesCases(): array + public static function provideFixWithIndentedMixedLinesCases(): iterable { return self::createTestCases([ [' diff --git a/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixerTest.php b/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixerTest.php index 02e5a1b9d39..5cd1e785d3d 100644 --- a/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixerTest.php +++ b/tests/Fixer/DoctrineAnnotation/DoctrineAnnotationSpacesFixerTest.php @@ -57,7 +57,7 @@ public function testFixAllWithDifferentLineEnding(string $expected, ?string $inp $this->testFixAll($expected, $input); } - public static function provideFixAllCases(): array + public static function provideFixAllCases(): iterable { $cases = self::createTestCases([ [' @@ -372,7 +372,7 @@ public function testFixAroundParenthesesOnlyWithDifferentLineEnding(string $expe $this->testFixAroundParenthesesOnly($expected, $input); } - public static function provideFixAroundParenthesesOnlyCases(): array + public static function provideFixAroundParenthesesOnlyCases(): iterable { return self::createTestCases([ [' @@ -626,7 +626,7 @@ public function testFixAroundCommasOnlyWithDifferentLineEnding(string $expected, $this->testFixAroundCommasOnly($expected, $input); } - public static function provideFixAroundCommasOnlyCases(): array + public static function provideFixAroundCommasOnlyCases(): iterable { return self::createTestCases([ [' @@ -892,7 +892,7 @@ public function testFixWithSpaceBeforeArgumentAssignmentOnlyWithDifferentLineEnd $this->testFixWithSpaceBeforeArgumentAssignmentOnly($expected, $input); } - public static function provideFixWithSpaceBeforeArgumentAssignmentOnlyCases(): array + public static function provideFixWithSpaceBeforeArgumentAssignmentOnlyCases(): iterable { return self::createTestCases([ [' @@ -940,7 +940,7 @@ public function testFixWithoutSpaceBeforeArgumentAssignmentOnlyWithDifferentLine $this->testFixWithoutSpaceBeforeArgumentAssignmentOnly($expected, $input); } - public static function provideFixWithoutSpaceBeforeArgumentAssignmentOnlyCases(): array + public static function provideFixWithoutSpaceBeforeArgumentAssignmentOnlyCases(): iterable { return self::createTestCases([ [' @@ -988,7 +988,7 @@ public function testFixWithSpaceAfterArgumentAssignmentOnlyWithDifferentLineEndi $this->testFixWithSpaceAfterArgumentAssignmentOnly($expected, $input); } - public static function provideFixWithSpaceAfterArgumentAssignmentOnlyCases(): array + public static function provideFixWithSpaceAfterArgumentAssignmentOnlyCases(): iterable { return self::createTestCases([ [' @@ -1036,7 +1036,7 @@ public function testFixWithoutSpaceAfterArgumentAssignmentOnlyWithDifferentLineE $this->testFixWithoutSpaceAfterArgumentAssignmentOnly($expected, $input); } - public static function provideFixWithoutSpaceAfterArgumentAssignmentOnlyCases(): array + public static function provideFixWithoutSpaceAfterArgumentAssignmentOnlyCases(): iterable { return self::createTestCases([ [' @@ -1084,7 +1084,7 @@ public function testFixWithSpaceBeforeArrayAssignmentEqualOnlyWithDifferentLineE $this->testFixWithSpaceBeforeArrayAssignmentEqualOnly($expected, $input); } - public static function provideFixWithSpaceBeforeArrayAssignmentEqualOnlyCases(): array + public static function provideFixWithSpaceBeforeArrayAssignmentEqualOnlyCases(): iterable { return self::createTestCases([ [' @@ -1132,7 +1132,7 @@ public function testFixWithoutSpaceBeforeArrayAssignmentEqualOnlyWithDifferentLi $this->testFixWithoutSpaceBeforeArrayAssignmentEqualOnly($expected, $input); } - public static function provideFixWithoutSpaceBeforeArrayAssignmentEqualOnlyCases(): array + public static function provideFixWithoutSpaceBeforeArrayAssignmentEqualOnlyCases(): iterable { return self::createTestCases([ [' @@ -1180,7 +1180,7 @@ public function testFixWithSpaceAfterArrayAssignmentEqualOnlyWithDifferentLineEn $this->testFixWithSpaceAfterArrayAssignmentEqualOnly($expected, $input); } - public static function provideFixWithSpaceAfterArrayAssignmentEqualOnlyCases(): array + public static function provideFixWithSpaceAfterArrayAssignmentEqualOnlyCases(): iterable { return self::createTestCases([ [' @@ -1228,7 +1228,7 @@ public function testFixWithoutSpaceAfterArrayAssignmentEqualOnlyWithDifferentLin $this->testFixWithoutSpaceAfterArrayAssignmentEqualOnly($expected, $input); } - public static function provideFixWithoutSpaceAfterArrayAssignmentEqualOnlyCases(): array + public static function provideFixWithoutSpaceAfterArrayAssignmentEqualOnlyCases(): iterable { return self::createTestCases([ [' @@ -1276,7 +1276,7 @@ public function testFixWithSpaceBeforeArrayAssignmentColonOnlyWithDifferentLineE $this->testFixWithSpaceBeforeArrayAssignmentColonOnly($expected, $input); } - public static function provideFixWithSpaceBeforeArrayAssignmentColonOnlyCases(): array + public static function provideFixWithSpaceBeforeArrayAssignmentColonOnlyCases(): iterable { return self::createTestCases([ [' @@ -1324,7 +1324,7 @@ public function testFixWithoutSpaceBeforeArrayAssignmentColonOnlyWithDifferentLi $this->testFixWithoutSpaceBeforeArrayAssignmentColonOnly($expected, $input); } - public static function provideFixWithoutSpaceBeforeArrayAssignmentColonOnlyCases(): array + public static function provideFixWithoutSpaceBeforeArrayAssignmentColonOnlyCases(): iterable { return self::createTestCases([ [' @@ -1372,7 +1372,7 @@ public function testFixWithSpaceAfterArrayAssignmentColonOnlyWithDifferentLineEn $this->testFixWithSpaceAfterArrayAssignmentColonOnly($expected, $input); } - public static function provideFixWithSpaceAfterArrayAssignmentColonOnlyCases(): array + public static function provideFixWithSpaceAfterArrayAssignmentColonOnlyCases(): iterable { return self::createTestCases([ [' @@ -1420,7 +1420,7 @@ public function testFixWithoutSpaceAfterArrayAssignmentColonOnlyWithDifferentLin $this->testFixWithoutSpaceAfterArrayAssignmentColonOnly($expected, $input); } - public static function provideFixWithoutSpaceAfterArrayAssignmentColonOnlyCases(): array + public static function provideFixWithoutSpaceAfterArrayAssignmentColonOnlyCases(): iterable { return self::createTestCases([ [' diff --git a/tests/Fixer/FunctionNotation/CombineNestedDirnameFixerTest.php b/tests/Fixer/FunctionNotation/CombineNestedDirnameFixerTest.php index c4d3c1768d6..c0b86d9b236 100644 --- a/tests/Fixer/FunctionNotation/CombineNestedDirnameFixerTest.php +++ b/tests/Fixer/FunctionNotation/CombineNestedDirnameFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/FopenFlagOrderFixerTest.php b/tests/Fixer/FunctionNotation/FopenFlagOrderFixerTest.php index 47126b7d5cd..af3de34f4ca 100644 --- a/tests/Fixer/FunctionNotation/FopenFlagOrderFixerTest.php +++ b/tests/Fixer/FunctionNotation/FopenFlagOrderFixerTest.php @@ -32,7 +32,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'most simple fix case' => [ diff --git a/tests/Fixer/FunctionNotation/FopenFlagsFixerTest.php b/tests/Fixer/FunctionNotation/FopenFlagsFixerTest.php index b851d9d3e1e..4f074660199 100644 --- a/tests/Fixer/FunctionNotation/FopenFlagsFixerTest.php +++ b/tests/Fixer/FunctionNotation/FopenFlagsFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, string $input, array $config = []): vo $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'missing "b"' => [ @@ -111,7 +111,7 @@ public function testDoNotFix(string $expected): void $this->doTest($expected); } - public static function provideDoNotFixCases(): array + public static function provideDoNotFixCases(): iterable { return [ 'not simple flags' => [ diff --git a/tests/Fixer/FunctionNotation/FunctionDeclarationFixerTest.php b/tests/Fixer/FunctionNotation/FunctionDeclarationFixerTest.php index b2f76da68f5..cf49d7be196 100644 --- a/tests/Fixer/FunctionNotation/FunctionDeclarationFixerTest.php +++ b/tests/Fixer/FunctionNotation/FunctionDeclarationFixerTest.php @@ -69,7 +69,7 @@ public function testFix(string $expected, ?string $input = null, array $configur $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/FunctionTypehintSpaceFixerTest.php b/tests/Fixer/FunctionNotation/FunctionTypehintSpaceFixerTest.php index aa86890008c..fb61e715f88 100644 --- a/tests/Fixer/FunctionNotation/FunctionTypehintSpaceFixerTest.php +++ b/tests/Fixer/FunctionNotation/FunctionTypehintSpaceFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/LambdaNotUsedImportFixerTest.php b/tests/Fixer/FunctionNotation/LambdaNotUsedImportFixerTest.php index 75d2160251c..a36259a7cca 100644 --- a/tests/Fixer/FunctionNotation/LambdaNotUsedImportFixerTest.php +++ b/tests/Fixer/FunctionNotation/LambdaNotUsedImportFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'simple' => [ diff --git a/tests/Fixer/FunctionNotation/MethodArgumentSpaceFixerTest.php b/tests/Fixer/FunctionNotation/MethodArgumentSpaceFixerTest.php index 68b2ff23ecd..454a3b0a03f 100644 --- a/tests/Fixer/FunctionNotation/MethodArgumentSpaceFixerTest.php +++ b/tests/Fixer/FunctionNotation/MethodArgumentSpaceFixerTest.php @@ -79,7 +79,7 @@ public function testFixWithDifferentLineEndings(string $expected, ?string $input ); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/NativeFunctionInvocationFixerTest.php b/tests/Fixer/FunctionNotation/NativeFunctionInvocationFixerTest.php index a1b0e3ce1b6..2f42f7b28a4 100644 --- a/tests/Fixer/FunctionNotation/NativeFunctionInvocationFixerTest.php +++ b/tests/Fixer/FunctionNotation/NativeFunctionInvocationFixerTest.php @@ -63,7 +63,7 @@ public function testConfigureRejectsInvalidConfigurationElement($element): void ]); } - public static function provideConfigureRejectsInvalidConfigurationElementCases(): array + public static function provideConfigureRejectsInvalidConfigurationElementCases(): iterable { return [ 'null' => [null], @@ -99,7 +99,7 @@ public function testConfigureIncludeSets( } } - public static function provideConfigureIncludeSetsCases(): array + public static function provideConfigureIncludeSetsCases(): iterable { return [ [['foo', 'bar']], @@ -173,7 +173,7 @@ public function testFixWithDefaultConfiguration(string $expected, ?string $input $this->doTest($expected, $input); } - public static function provideFixWithDefaultConfigurationCases(): array + public static function provideFixWithDefaultConfigurationCases(): iterable { return [ [ @@ -273,7 +273,7 @@ public function testFixWithConfiguredExclude(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixWithConfiguredExcludeCases(): array + public static function provideFixWithConfiguredExcludeCases(): iterable { return [ [ @@ -306,7 +306,7 @@ public function testFixWithNamespaceConfiguration(string $expected, ?string $inp $this->doTest($expected, $input); } - public static function provideFixWithNamespaceConfigurationCases(): array + public static function provideFixWithNamespaceConfigurationCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixerTest.php b/tests/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixerTest.php index 6b43ed2f7e0..2f5863227a5 100644 --- a/tests/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixerTest.php +++ b/tests/Fixer/FunctionNotation/NoUnreachableDefaultArgumentValueFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/PhpdocToParamTypeFixerTest.php b/tests/Fixer/FunctionNotation/PhpdocToParamTypeFixerTest.php index 62771049839..6aed6c276eb 100644 --- a/tests/Fixer/FunctionNotation/PhpdocToParamTypeFixerTest.php +++ b/tests/Fixer/FunctionNotation/PhpdocToParamTypeFixerTest.php @@ -45,7 +45,7 @@ public function testFix(string $expected, ?string $input = null, ?int $versionSp $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'typehint already defined' => [ diff --git a/tests/Fixer/FunctionNotation/PhpdocToPropertyTypeFixerTest.php b/tests/Fixer/FunctionNotation/PhpdocToPropertyTypeFixerTest.php index 55196dbcbb8..5597d6c1d18 100644 --- a/tests/Fixer/FunctionNotation/PhpdocToPropertyTypeFixerTest.php +++ b/tests/Fixer/FunctionNotation/PhpdocToPropertyTypeFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'no phpdoc return' => [ diff --git a/tests/Fixer/FunctionNotation/ReturnTypeDeclarationFixerTest.php b/tests/Fixer/FunctionNotation/ReturnTypeDeclarationFixerTest.php index d49009016ad..ffae79f75a8 100644 --- a/tests/Fixer/FunctionNotation/ReturnTypeDeclarationFixerTest.php +++ b/tests/Fixer/FunctionNotation/ReturnTypeDeclarationFixerTest.php @@ -57,7 +57,7 @@ public function testFixWithSpaceBeforeNone(string $expected, ?string $input = nu $this->doTest($expected, $input); } - public static function provideFixWithSpaceBeforeNoneCases(): array + public static function provideFixWithSpaceBeforeNoneCases(): iterable { return [ [ @@ -127,7 +127,7 @@ public function testFixWithSpaceBeforeOne(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideFixWithSpaceBeforeOneCases(): array + public static function provideFixWithSpaceBeforeOneCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/StaticLambdaFixerTest.php b/tests/Fixer/FunctionNotation/StaticLambdaFixerTest.php index 00b2d46d9b7..f94a26798ee 100644 --- a/tests/Fixer/FunctionNotation/StaticLambdaFixerTest.php +++ b/tests/Fixer/FunctionNotation/StaticLambdaFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'sample' => [ @@ -132,7 +132,7 @@ public function testDoNotFix(string $expected): void $this->doTest($expected); } - public static function provideDoNotFixCases(): array + public static function provideDoNotFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/UseArrowFunctionsFixerTest.php b/tests/Fixer/FunctionNotation/UseArrowFunctionsFixerTest.php index 680eedf033b..d95ab66c08b 100644 --- a/tests/Fixer/FunctionNotation/UseArrowFunctionsFixerTest.php +++ b/tests/Fixer/FunctionNotation/UseArrowFunctionsFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/FunctionNotation/VoidReturnFixerTest.php b/tests/Fixer/FunctionNotation/VoidReturnFixerTest.php index f68c02396a3..7745945da8f 100644 --- a/tests/Fixer/FunctionNotation/VoidReturnFixerTest.php +++ b/tests/Fixer/FunctionNotation/VoidReturnFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [' [ diff --git a/tests/Fixer/Import/GlobalNamespaceImportFixerTest.php b/tests/Fixer/Import/GlobalNamespaceImportFixerTest.php index 486d2bd1f8c..e6762334c61 100644 --- a/tests/Fixer/Import/GlobalNamespaceImportFixerTest.php +++ b/tests/Fixer/Import/GlobalNamespaceImportFixerTest.php @@ -34,7 +34,7 @@ public function testFixImportConstants(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixImportConstantsCases(): array + public static function provideFixImportConstantsCases(): iterable { return [ 'non-global names' => [ @@ -235,7 +235,7 @@ public function testFixImportFunctions(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixImportFunctionsCases(): array + public static function provideFixImportFunctionsCases(): iterable { return [ 'non-global names' => [ @@ -439,7 +439,7 @@ public function testFixImportClasses(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixImportClassesCases(): array + public static function provideFixImportClassesCases(): iterable { return [ 'non-global names' => [ @@ -726,7 +726,7 @@ public function testFixFullyQualifyConstants(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixFullyQualifyConstantsCases(): array + public static function provideFixFullyQualifyConstantsCases(): iterable { return [ 'already fqn or sub namespace' => [ @@ -785,7 +785,7 @@ public function testFixFullyQualifyFunctions(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixFullyQualifyFunctionsCases(): array + public static function provideFixFullyQualifyFunctionsCases(): iterable { return [ 'already fqn or sub namespace' => [ @@ -851,7 +851,7 @@ public function testFixFullyQualifyClasses(string $expected, ?string $input = nu $this->doTest($expected, $input); } - public static function provideFixFullyQualifyClassesCases(): array + public static function provideFixFullyQualifyClassesCases(): iterable { return [ 'already fqn or sub namespace' => [ diff --git a/tests/Fixer/Import/NoLeadingImportSlashFixerTest.php b/tests/Fixer/Import/NoLeadingImportSlashFixerTest.php index 00b58548e2f..ccbf3f48a4c 100644 --- a/tests/Fixer/Import/NoLeadingImportSlashFixerTest.php +++ b/tests/Fixer/Import/NoLeadingImportSlashFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Import/NoUnusedImportsFixerTest.php b/tests/Fixer/Import/NoUnusedImportsFixerTest.php index e339c50ee8d..c5e95cf6a23 100644 --- a/tests/Fixer/Import/NoUnusedImportsFixerTest.php +++ b/tests/Fixer/Import/NoUnusedImportsFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'simple' => [ diff --git a/tests/Fixer/Import/OrderedImportsFixerTest.php b/tests/Fixer/Import/OrderedImportsFixerTest.php index a896874fb0d..7a45d279685 100644 --- a/tests/Fixer/Import/OrderedImportsFixerTest.php +++ b/tests/Fixer/Import/OrderedImportsFixerTest.php @@ -1129,7 +1129,7 @@ public function testInvalidSortAlgorithm(array $configuration, string $expectedV $this->fixer->configure($configuration); } - public static function provideInvalidSortAlgorithmCases(): array + public static function provideInvalidSortAlgorithmCases(): iterable { return [ [ @@ -1745,7 +1745,7 @@ public function testFixByLength(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixByLengthCases(): array + public static function provideFixByLengthCases(): iterable { return [ [ @@ -1891,7 +1891,7 @@ public function testFixTypesOrderAndLength(string $expected, ?string $input = nu $this->doTest($expected, $input); } - public static function provideFixTypesOrderAndLengthCases(): array + public static function provideFixTypesOrderAndLengthCases(): iterable { return [ [ @@ -2016,7 +2016,7 @@ public function testFixTypesOrderAndNone(string $expected, ?string $input = null $this->doTest($expected, $input); } - public static function provideFixTypesOrderAndNoneCases(): array + public static function provideFixTypesOrderAndNoneCases(): iterable { return [ [ diff --git a/tests/Fixer/Import/SingleImportPerStatementFixerTest.php b/tests/Fixer/Import/SingleImportPerStatementFixerTest.php index 7751ef09310..fc16f2a2ca4 100644 --- a/tests/Fixer/Import/SingleImportPerStatementFixerTest.php +++ b/tests/Fixer/Import/SingleImportPerStatementFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Import/SingleLineAfterImportsFixerTest.php b/tests/Fixer/Import/SingleLineAfterImportsFixerTest.php index 17bf3627d20..4b8ea15efdc 100644 --- a/tests/Fixer/Import/SingleLineAfterImportsFixerTest.php +++ b/tests/Fixer/Import/SingleLineAfterImportsFixerTest.php @@ -514,7 +514,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php b/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php index 0a793b8490c..aa2feb1b079 100644 --- a/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php +++ b/tests/Fixer/LanguageConstruct/ClassKeywordRemoveFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixerTest.php b/tests/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixerTest.php index 2131c57efab..f7b39d609c0 100644 --- a/tests/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixerTest.php +++ b/tests/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/LanguageConstruct/DeclareEqualNormalizeFixerTest.php b/tests/Fixer/LanguageConstruct/DeclareEqualNormalizeFixerTest.php index 05debd7fefe..220ab11044d 100644 --- a/tests/Fixer/LanguageConstruct/DeclareEqualNormalizeFixerTest.php +++ b/tests/Fixer/LanguageConstruct/DeclareEqualNormalizeFixerTest.php @@ -37,7 +37,7 @@ public function testFix(string $expected, ?string $input, array $config): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'minimal case remove whitespace (default config)' => [ @@ -115,7 +115,7 @@ public function testInvalidConfig(array $config, string $expectedMessage): void $this->fixer->configure($config); } - public static function provideInvalidConfigCases(): array + public static function provideInvalidConfigCases(): iterable { return [ [ diff --git a/tests/Fixer/LanguageConstruct/DirConstantFixerTest.php b/tests/Fixer/LanguageConstruct/DirConstantFixerTest.php index 371bb5f053b..408cda7d659 100644 --- a/tests/Fixer/LanguageConstruct/DirConstantFixerTest.php +++ b/tests/Fixer/LanguageConstruct/DirConstantFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $multiLinePatternToFix = <<<'FIX' doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -82,7 +82,7 @@ public function testFix80($expected, $input): void $this->doTest($expected, $input); } - public static function provideFix80Cases(): array + public static function provideFix80Cases(): iterable { return [ [ diff --git a/tests/Fixer/LanguageConstruct/FunctionToConstantFixerTest.php b/tests/Fixer/LanguageConstruct/FunctionToConstantFixerTest.php index fae1687414c..14bf5563878 100644 --- a/tests/Fixer/LanguageConstruct/FunctionToConstantFixerTest.php +++ b/tests/Fixer/LanguageConstruct/FunctionToConstantFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'Minimal case, alternative casing, alternative statement end.' => [ @@ -256,7 +256,7 @@ public function testInvalidConfigurationKeys(array $config): void $this->fixer->configure($config); } - public static function provideInvalidConfigurationKeysCases(): array + public static function provideInvalidConfigurationKeysCases(): iterable { return [ [['functions' => ['a']]], diff --git a/tests/Fixer/LanguageConstruct/IsNullFixerTest.php b/tests/Fixer/LanguageConstruct/IsNullFixerTest.php index 84edf94e9b9..07f816053ba 100644 --- a/tests/Fixer/LanguageConstruct/IsNullFixerTest.php +++ b/tests/Fixer/LanguageConstruct/IsNullFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $multiLinePatternToFix = <<<'FIX' [null], @@ -70,7 +70,7 @@ public function testFixWithAbstract(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithAbstractCases(): array + public static function provideFixWithAbstractCases(): iterable { return [ [ @@ -166,7 +166,7 @@ public function testFixWithBreak(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithBreakCases(): array + public static function provideFixWithBreakCases(): iterable { return [ [ @@ -215,7 +215,7 @@ public function testFixWithAs(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithAsCases(): array + public static function provideFixWithAsCases(): iterable { return [ [ @@ -331,7 +331,7 @@ public function testFixWithCase(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCaseCases(): array + public static function provideFixWithCaseCases(): iterable { return [ [ @@ -401,7 +401,7 @@ public function testFixWithCatch(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCatchCases(): array + public static function provideFixWithCatchCases(): iterable { return [ [ @@ -443,7 +443,7 @@ public function testFixWithClass(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithClassCases(): array + public static function provideFixWithClassCases(): iterable { return [ [ @@ -517,7 +517,7 @@ public function testFixWithContinue(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithContinueCases(): array + public static function provideFixWithContinueCases(): iterable { return [ [ @@ -562,7 +562,7 @@ public function testFixWithConst(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithConstCases(): array + public static function provideFixWithConstCases(): iterable { return [ [ @@ -644,7 +644,7 @@ public function testFixWithConstImport(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithConstImportCases(): array + public static function provideFixWithConstImportCases(): iterable { return [ [ @@ -682,7 +682,7 @@ public function testFixWithClone(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCloneCases(): array + public static function provideFixWithCloneCases(): iterable { return [ [ @@ -720,7 +720,7 @@ public function testFixWithDo(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithDoCases(): array + public static function provideFixWithDoCases(): iterable { return [ [ @@ -766,7 +766,7 @@ public function testFixWithEcho(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithEchoCases(): array + public static function provideFixWithEchoCases(): iterable { return [ [ @@ -804,7 +804,7 @@ public function testFixWithElse(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithElseCases(): array + public static function provideFixWithElseCases(): iterable { return [ [ @@ -842,7 +842,7 @@ public function testFixWithElseIf(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithElseIfCases(): array + public static function provideFixWithElseIfCases(): iterable { return [ [ @@ -880,7 +880,7 @@ public function testFixWithExtends(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithExtendsCases(): array + public static function provideFixWithExtendsCases(): iterable { return [ [ @@ -979,7 +979,7 @@ public function testFixWithFinal(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithFinalCases(): array + public static function provideFixWithFinalCases(): iterable { return [ [ @@ -1075,7 +1075,7 @@ public function testFixWithFinally(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithFinallyCases(): array + public static function provideFixWithFinallyCases(): iterable { return [ [ @@ -1117,7 +1117,7 @@ public function testFixWithFor(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithForCases(): array + public static function provideFixWithForCases(): iterable { return [ [ @@ -1159,7 +1159,7 @@ public function testFixWithForeach(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithForeachCases(): array + public static function provideFixWithForeachCases(): iterable { return [ [ @@ -1201,7 +1201,7 @@ public function testFixWithFunction(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithFunctionCases(): array + public static function provideFixWithFunctionCases(): iterable { return [ [ @@ -1297,7 +1297,7 @@ public function testFixWithFunctionImport(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideFixWithFunctionImportCases(): array + public static function provideFixWithFunctionImportCases(): iterable { return [ [ @@ -1335,7 +1335,7 @@ public function testFixWithGlobal(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithGlobalCases(): array + public static function provideFixWithGlobalCases(): iterable { return [ [ @@ -1377,7 +1377,7 @@ public function testFixWithGoto(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithGotoCases(): array + public static function provideFixWithGotoCases(): iterable { return [ [ @@ -1411,7 +1411,7 @@ public function testFixWithIf(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithIfCases(): array + public static function provideFixWithIfCases(): iterable { return [ [ @@ -1449,7 +1449,7 @@ public function testFixWithImplements(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithImplementsCases(): array + public static function provideFixWithImplementsCases(): iterable { return [ [ @@ -1512,7 +1512,7 @@ public function testFixWithInclude(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithIncludeCases(): array + public static function provideFixWithIncludeCases(): iterable { return [ [ @@ -1550,7 +1550,7 @@ public function testFixWithIncludeOnce(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithIncludeOnceCases(): array + public static function provideFixWithIncludeOnceCases(): iterable { return [ [ @@ -1588,7 +1588,7 @@ public function testFixWithInstanceof(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithInstanceofCases(): array + public static function provideFixWithInstanceofCases(): iterable { return [ [ @@ -1630,7 +1630,7 @@ public function testFixWithInsteadof(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithInsteadofCases(): array + public static function provideFixWithInsteadofCases(): iterable { return [ [ @@ -1724,7 +1724,7 @@ public function testFixWithInterface(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithInterfaceCases(): array + public static function provideFixWithInterfaceCases(): iterable { return [ [ @@ -1762,7 +1762,7 @@ public function testFixWithNew(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithNewCases(): array + public static function provideFixWithNewCases(): iterable { return [ [ @@ -1800,7 +1800,7 @@ public function testFixWithOpenTagWithEcho(string $expected, ?string $input = nu $this->doTest($expected, $input); } - public static function provideFixWithOpenTagWithEchoCases(): array + public static function provideFixWithOpenTagWithEchoCases(): iterable { return [ [ @@ -1842,7 +1842,7 @@ public function testFixWithPrint(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithPrintCases(): array + public static function provideFixWithPrintCases(): iterable { return [ [ @@ -1880,7 +1880,7 @@ public function testFixWithPrivate(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithPrivateCases(): array + public static function provideFixWithPrivateCases(): iterable { return [ [ @@ -1958,7 +1958,7 @@ public function testFixWithProtected(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithProtectedCases(): array + public static function provideFixWithProtectedCases(): iterable { return [ [ @@ -2036,7 +2036,7 @@ public function testFixWithPublic(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithPublicCases(): array + public static function provideFixWithPublicCases(): iterable { return [ [ @@ -2114,7 +2114,7 @@ public function testFixWithRequire(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithRequireCases(): array + public static function provideFixWithRequireCases(): iterable { return [ [ @@ -2152,7 +2152,7 @@ public function testFixWithRequireOnce(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithRequireOnceCases(): array + public static function provideFixWithRequireOnceCases(): iterable { return [ [ @@ -2190,7 +2190,7 @@ public function testFixWithReturn(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithReturnCases(): array + public static function provideFixWithReturnCases(): iterable { return [ [ @@ -2324,7 +2324,7 @@ public function testFixWithStatic(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithStaticCases(): array + public static function provideFixWithStaticCases(): iterable { return [ [ @@ -2390,7 +2390,7 @@ public function testFixWithThrow(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithThrowCases(): array + public static function provideFixWithThrowCases(): iterable { return [ [ @@ -2428,7 +2428,7 @@ public function testFixWithTrait(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithTraitCases(): array + public static function provideFixWithTraitCases(): iterable { return [ [ @@ -2466,7 +2466,7 @@ public function testFixWithTry(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithTryCases(): array + public static function provideFixWithTryCases(): iterable { return [ [ @@ -2508,7 +2508,7 @@ public function testFixWithUse(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithUseCases(): array + public static function provideFixWithUseCases(): iterable { return [ [ @@ -2582,7 +2582,7 @@ public function testFixWithUseLambda(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithUseLambdaCases(): array + public static function provideFixWithUseLambdaCases(): iterable { return [ [ @@ -2624,7 +2624,7 @@ public function testFixWithUseTrait(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithUseTraitCases(): array + public static function provideFixWithUseTraitCases(): iterable { return [ [ @@ -2662,7 +2662,7 @@ public function testFixWithVar(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithVarCases(): array + public static function provideFixWithVarCases(): iterable { return [ [ @@ -2704,7 +2704,7 @@ public function testFixWithWhile(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithWhileCases(): array + public static function provideFixWithWhileCases(): iterable { return [ [ @@ -2746,7 +2746,7 @@ public function testFixWithYield(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithYieldCases(): array + public static function provideFixWithYieldCases(): iterable { return [ [ @@ -2784,7 +2784,7 @@ public function testFixWithYieldFrom(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithYieldFromCases(): array + public static function provideFixWithYieldFromCases(): iterable { return [ [ @@ -2858,7 +2858,7 @@ public function testFixWithPhpOpen(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithPhpOpenCases(): array + public static function provideFixWithPhpOpenCases(): iterable { return [ [ diff --git a/tests/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixerTest.php b/tests/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixerTest.php index 17bbc386547..ea1310cb412 100644 --- a/tests/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixerTest.php +++ b/tests/Fixer/LanguageConstruct/SingleSpaceAroundConstructFixerTest.php @@ -43,7 +43,7 @@ public function testConfigureRejectsInvalidControlStatement($construct): void ]); } - public static function provideConfigureRejectsInvalidControlStatementCases(): array + public static function provideConfigureRejectsInvalidControlStatementCases(): iterable { return [ 'null' => [null], @@ -71,7 +71,7 @@ public function testFixWithAbstract(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithAbstractCases(): array + public static function provideFixWithAbstractCases(): iterable { return [ [ @@ -167,7 +167,7 @@ public function testFixWithBreak(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithBreakCases(): array + public static function provideFixWithBreakCases(): iterable { return [ [ @@ -214,7 +214,7 @@ public function testFixWithAs(string $expected, ?string $input = null, array $co $this->doTest($expected, $input); } - public static function provideFixWithAsCases(): array + public static function provideFixWithAsCases(): iterable { return [ [ @@ -561,7 +561,7 @@ public function testFixWithCase(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCaseCases(): array + public static function provideFixWithCaseCases(): iterable { return [ [ @@ -631,7 +631,7 @@ public function testFixWithCatch(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCatchCases(): array + public static function provideFixWithCatchCases(): iterable { return [ [ @@ -673,7 +673,7 @@ public function testFixWithClass(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithClassCases(): array + public static function provideFixWithClassCases(): iterable { return [ [ @@ -747,7 +747,7 @@ public function testFixWithContinue(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithContinueCases(): array + public static function provideFixWithContinueCases(): iterable { return [ [ @@ -792,7 +792,7 @@ public function testFixWithConst(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithConstCases(): array + public static function provideFixWithConstCases(): iterable { return [ [ @@ -874,7 +874,7 @@ public function testFixWithConstImport(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithConstImportCases(): array + public static function provideFixWithConstImportCases(): iterable { return [ [ @@ -912,7 +912,7 @@ public function testFixWithClone(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCloneCases(): array + public static function provideFixWithCloneCases(): iterable { return [ [ @@ -950,7 +950,7 @@ public function testFixWithDo(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithDoCases(): array + public static function provideFixWithDoCases(): iterable { return [ [ @@ -996,7 +996,7 @@ public function testFixWithEcho(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithEchoCases(): array + public static function provideFixWithEchoCases(): iterable { return [ [ @@ -1034,7 +1034,7 @@ public function testFixWithElse(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithElseCases(): array + public static function provideFixWithElseCases(): iterable { return [ [ @@ -1072,7 +1072,7 @@ public function testFixWithElseIf(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithElseIfCases(): array + public static function provideFixWithElseIfCases(): iterable { return [ [ @@ -1110,7 +1110,7 @@ public function testFixWithExtends(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithExtendsCases(): array + public static function provideFixWithExtendsCases(): iterable { return [ [ @@ -1209,7 +1209,7 @@ public function testFixWithFinal(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithFinalCases(): array + public static function provideFixWithFinalCases(): iterable { return [ [ @@ -1305,7 +1305,7 @@ public function testFixWithFinally(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithFinallyCases(): array + public static function provideFixWithFinallyCases(): iterable { return [ [ @@ -1347,7 +1347,7 @@ public function testFixWithFor(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithForCases(): array + public static function provideFixWithForCases(): iterable { return [ [ @@ -1389,7 +1389,7 @@ public function testFixWithForeach(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithForeachCases(): array + public static function provideFixWithForeachCases(): iterable { return [ [ @@ -1431,7 +1431,7 @@ public function testFixWithFunction(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithFunctionCases(): array + public static function provideFixWithFunctionCases(): iterable { return [ [ @@ -1527,7 +1527,7 @@ public function testFixWithFunctionImport(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideFixWithFunctionImportCases(): array + public static function provideFixWithFunctionImportCases(): iterable { return [ [ @@ -1565,7 +1565,7 @@ public function testFixWithGlobal(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithGlobalCases(): array + public static function provideFixWithGlobalCases(): iterable { return [ [ @@ -1607,7 +1607,7 @@ public function testFixWithGoto(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithGotoCases(): array + public static function provideFixWithGotoCases(): iterable { return [ [ @@ -1641,7 +1641,7 @@ public function testFixWithIf(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithIfCases(): array + public static function provideFixWithIfCases(): iterable { return [ [ @@ -1679,7 +1679,7 @@ public function testFixWithImplements(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithImplementsCases(): array + public static function provideFixWithImplementsCases(): iterable { return [ [ @@ -1742,7 +1742,7 @@ public function testFixWithInclude(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithIncludeCases(): array + public static function provideFixWithIncludeCases(): iterable { return [ [ @@ -1780,7 +1780,7 @@ public function testFixWithIncludeOnce(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithIncludeOnceCases(): array + public static function provideFixWithIncludeOnceCases(): iterable { return [ [ @@ -1818,7 +1818,7 @@ public function testFixWithInstanceof(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithInstanceofCases(): array + public static function provideFixWithInstanceofCases(): iterable { return [ [ @@ -1860,7 +1860,7 @@ public function testFixWithInsteadof(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithInsteadofCases(): array + public static function provideFixWithInsteadofCases(): iterable { return [ [ @@ -1954,7 +1954,7 @@ public function testFixWithInterface(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithInterfaceCases(): array + public static function provideFixWithInterfaceCases(): iterable { return [ [ @@ -1992,7 +1992,7 @@ public function testFixWithNew(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithNewCases(): array + public static function provideFixWithNewCases(): iterable { return [ [ @@ -2030,7 +2030,7 @@ public function testFixWithOpenTagWithEcho(string $expected, ?string $input = nu $this->doTest($expected, $input); } - public static function provideFixWithOpenTagWithEchoCases(): array + public static function provideFixWithOpenTagWithEchoCases(): iterable { return [ [ @@ -2072,7 +2072,7 @@ public function testFixWithPrint(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithPrintCases(): array + public static function provideFixWithPrintCases(): iterable { return [ [ @@ -2110,7 +2110,7 @@ public function testFixWithPrivate(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithPrivateCases(): array + public static function provideFixWithPrivateCases(): iterable { return [ [ @@ -2188,7 +2188,7 @@ public function testFixWithProtected(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithProtectedCases(): array + public static function provideFixWithProtectedCases(): iterable { return [ [ @@ -2266,7 +2266,7 @@ public function testFixWithPublic(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithPublicCases(): array + public static function provideFixWithPublicCases(): iterable { return [ [ @@ -2344,7 +2344,7 @@ public function testFixWithRequire(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithRequireCases(): array + public static function provideFixWithRequireCases(): iterable { return [ [ @@ -2382,7 +2382,7 @@ public function testFixWithRequireOnce(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithRequireOnceCases(): array + public static function provideFixWithRequireOnceCases(): iterable { return [ [ @@ -2420,7 +2420,7 @@ public function testFixWithReturn(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithReturnCases(): array + public static function provideFixWithReturnCases(): iterable { return [ [ @@ -2554,7 +2554,7 @@ public function testFixWithStatic(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithStaticCases(): array + public static function provideFixWithStaticCases(): iterable { return [ [ @@ -2645,7 +2645,7 @@ public function testFixWithThrow(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithThrowCases(): array + public static function provideFixWithThrowCases(): iterable { return [ [ @@ -2683,7 +2683,7 @@ public function testFixWithTrait(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithTraitCases(): array + public static function provideFixWithTraitCases(): iterable { return [ [ @@ -2721,7 +2721,7 @@ public function testFixWithTry(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithTryCases(): array + public static function provideFixWithTryCases(): iterable { return [ [ @@ -2763,7 +2763,7 @@ public function testFixWithUse(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithUseCases(): array + public static function provideFixWithUseCases(): iterable { return [ [ @@ -2835,7 +2835,7 @@ public function testFixWithUseLambda(string $expected, ?string $input = null, ?a $this->doTest($expected, $input); } - public static function provideFixWithUseLambdaCases(): array + public static function provideFixWithUseLambdaCases(): iterable { return [ [ @@ -2913,7 +2913,7 @@ public function testFixWithUseTrait(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithUseTraitCases(): array + public static function provideFixWithUseTraitCases(): iterable { return [ [ @@ -2951,7 +2951,7 @@ public function testFixWithVar(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithVarCases(): array + public static function provideFixWithVarCases(): iterable { return [ [ @@ -2993,7 +2993,7 @@ public function testFixWithWhile(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithWhileCases(): array + public static function provideFixWithWhileCases(): iterable { return [ [ @@ -3035,7 +3035,7 @@ public function testFixWithYield(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithYieldCases(): array + public static function provideFixWithYieldCases(): iterable { return [ [ @@ -3071,7 +3071,7 @@ public function testFixWithYieldFrom(string $expected, ?string $input = null, ?a $this->doTest($expected, $input); } - public static function provideFixWithYieldFromCases(): array + public static function provideFixWithYieldFromCases(): iterable { $configFollowed = [ 'constructs_contain_a_single_space' => [ @@ -3189,7 +3189,7 @@ public function testFixWithPhpOpen(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithPhpOpenCases(): array + public static function provideFixWithPhpOpenCases(): iterable { return [ [ diff --git a/tests/Fixer/ListNotation/ListSyntaxFixerTest.php b/tests/Fixer/ListNotation/ListSyntaxFixerTest.php index 41004ea2c38..74fd89b4701 100644 --- a/tests/Fixer/ListNotation/ListSyntaxFixerTest.php +++ b/tests/Fixer/ListNotation/ListSyntaxFixerTest.php @@ -104,7 +104,7 @@ public function testFixToShortSyntax(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixToShortSyntaxCases(): array + public static function provideFixToShortSyntaxCases(): iterable { return [ [ diff --git a/tests/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixerTest.php b/tests/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixerTest.php index caa0c002b92..419b297db74 100644 --- a/tests/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixerTest.php +++ b/tests/Fixer/NamespaceNotation/BlankLineAfterNamespaceFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -226,7 +226,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixerTest.php b/tests/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixerTest.php index 457f1e24ffc..4f06ca00150 100644 --- a/tests/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixerTest.php +++ b/tests/Fixer/NamespaceNotation/NoBlankLinesBeforeNamespaceFixerTest.php @@ -37,7 +37,7 @@ public function testFix(string $expected, ?string $input = null, WhitespacesFixe $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $manySpaces = []; @@ -150,7 +150,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixerTest.php b/tests/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixerTest.php index c87249d0e2d..d23ed63c819 100644 --- a/tests/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixerTest.php +++ b/tests/Fixer/NamespaceNotation/SingleBlankLineBeforeNamespaceFixerTest.php @@ -37,7 +37,7 @@ public function testFix(string $expected, ?string $input = null, WhitespacesFixe $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ["doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideWithTabsCases(): array + public static function provideWithTabsCases(): iterable { return [ [ @@ -87,7 +87,7 @@ public function testConfigured(string $expected, ?string $input = null, array $c $this->doTest($expected, $input); } - public static function provideConfiguredCases(): array + public static function provideConfiguredCases(): iterable { return [ [ @@ -525,7 +525,7 @@ public function testFixDefaults(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixDefaultsCases(): array + public static function provideFixDefaultsCases(): iterable { return [ [ @@ -724,7 +724,7 @@ public function testUnalignEquals(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideUnalignEqualsCases(): array + public static function provideUnalignEqualsCases(): iterable { return [ [ @@ -900,7 +900,7 @@ public function testUnalignDoubleArrow(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideUnalignDoubleArrowCases(): array + public static function provideUnalignDoubleArrowCases(): iterable { return [ [ @@ -1295,7 +1295,7 @@ public function testFixAlignEquals(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixAlignEqualsCases(): array + public static function provideFixAlignEqualsCases(): iterable { return [ [ @@ -1642,7 +1642,7 @@ public function testFixAlignDoubleArrow(string $expected, ?string $input = null) $this->doTest($expected, $input); } - public static function provideFixAlignDoubleArrowCases(): array + public static function provideFixAlignDoubleArrowCases(): iterable { return [ [ @@ -2339,7 +2339,7 @@ public function testFixAlignScopedDoubleArrow(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideFixAlignScopedDoubleArrowCases(): array + public static function provideFixAlignScopedDoubleArrowCases(): iterable { return [ [ @@ -3068,7 +3068,7 @@ public function testFixPhp74(string $expected, ?string $input = null, array $con $this->doTest($expected, $input); } - public static function provideFixPhp74Cases(): array + public static function provideFixPhp74Cases(): iterable { return [ [ diff --git a/tests/Fixer/Operator/ConcatSpaceFixerTest.php b/tests/Fixer/Operator/ConcatSpaceFixerTest.php index a457dbcd9c0..a3f77c8c98c 100644 --- a/tests/Fixer/Operator/ConcatSpaceFixerTest.php +++ b/tests/Fixer/Operator/ConcatSpaceFixerTest.php @@ -51,7 +51,7 @@ public function testFixWithoutSpace(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithoutSpaceCases(): array + public static function provideFixWithoutSpaceCases(): iterable { return [ [ @@ -150,7 +150,7 @@ public function testFixWithSpace(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithSpaceCases(): array + public static function provideFixWithSpaceCases(): iterable { return [ [ diff --git a/tests/Fixer/Operator/IncrementStyleFixerTest.php b/tests/Fixer/Operator/IncrementStyleFixerTest.php index df19d51e3e5..cd664bd7523 100644 --- a/tests/Fixer/Operator/IncrementStyleFixerTest.php +++ b/tests/Fixer/Operator/IncrementStyleFixerTest.php @@ -46,14 +46,14 @@ public function testFixPostIncrement(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixPostIncrementCases(): array + public static function provideFixPostIncrementCases(): iterable { return array_map(static function (array $case): array { return array_reverse($case); }, self::provideFixPreIncrementCases()); } - public static function provideFixPreIncrementCases(): array + public static function provideFixPreIncrementCases(): iterable { $cases = [ [ diff --git a/tests/Fixer/Operator/LogicalOperatorsFixerTest.php b/tests/Fixer/Operator/LogicalOperatorsFixerTest.php index 575f594bdd0..943e810f396 100644 --- a/tests/Fixer/Operator/LogicalOperatorsFixerTest.php +++ b/tests/Fixer/Operator/LogicalOperatorsFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Operator/NotOperatorWithSpaceFixerTest.php b/tests/Fixer/Operator/NotOperatorWithSpaceFixerTest.php index fad3799bb99..419a4151274 100644 --- a/tests/Fixer/Operator/NotOperatorWithSpaceFixerTest.php +++ b/tests/Fixer/Operator/NotOperatorWithSpaceFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Operator/NotOperatorWithSuccessorSpaceFixerTest.php b/tests/Fixer/Operator/NotOperatorWithSuccessorSpaceFixerTest.php index 2069e6240e3..c26541b60b1 100644 --- a/tests/Fixer/Operator/NotOperatorWithSuccessorSpaceFixerTest.php +++ b/tests/Fixer/Operator/NotOperatorWithSuccessorSpaceFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixerTest.php b/tests/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixerTest.php index ec9f002d175..67285193488 100644 --- a/tests/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixerTest.php +++ b/tests/Fixer/Operator/ObjectOperatorWithoutWhitespaceFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Operator/StandardizeNotEqualsFixerTest.php b/tests/Fixer/Operator/StandardizeNotEqualsFixerTest.php index 1f1ab97e256..4abc2759661 100644 --- a/tests/Fixer/Operator/StandardizeNotEqualsFixerTest.php +++ b/tests/Fixer/Operator/StandardizeNotEqualsFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'handle goto labels 1' => [ @@ -207,7 +207,7 @@ public function testFix80(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFix80Cases(): array + public static function provideFix80Cases(): iterable { return [ 'nullable types in constructor property promotion' => [ diff --git a/tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php b/tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php index 36068165ab6..8ec435637d1 100644 --- a/tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php +++ b/tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php @@ -502,7 +502,7 @@ public function testDoNotFix80(string $input): void $this->doTest($input); } - public static function provideDoNotFix80Cases(): array + public static function provideDoNotFix80Cases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpTag/BlankLineAfterOpeningTagFixerTest.php b/tests/Fixer/PhpTag/BlankLineAfterOpeningTagFixerTest.php index f8f661aadba..da129d66905 100644 --- a/tests/Fixer/PhpTag/BlankLineAfterOpeningTagFixerTest.php +++ b/tests/Fixer/PhpTag/BlankLineAfterOpeningTagFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -141,7 +141,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpTag/EchoTagSyntaxFixerTest.php b/tests/Fixer/PhpTag/EchoTagSyntaxFixerTest.php index c95c11160bb..401d81868b7 100644 --- a/tests/Fixer/PhpTag/EchoTagSyntaxFixerTest.php +++ b/tests/Fixer/PhpTag/EchoTagSyntaxFixerTest.php @@ -35,7 +35,7 @@ public function testLongToShortFormat(string $expected, ?string $input = null, b $this->doTest($expected, $input); } - public static function provideLongToShortFormatCases(): array + public static function provideLongToShortFormatCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideShortToLongFormatCases(): array + public static function provideShortToLongFormatCases(): iterable { $cases = [ [' 1;', 'doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -98,7 +98,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpTag/NoClosingTagFixerTest.php b/tests/Fixer/PhpTag/NoClosingTagFixerTest.php index 9cf3695c999..851bc6b4e08 100644 --- a/tests/Fixer/PhpTag/NoClosingTagFixerTest.php +++ b/tests/Fixer/PhpTag/NoClosingTagFixerTest.php @@ -43,7 +43,7 @@ public function testWithShortOpenTag(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideWithFullOpenTagCases(): array + public static function provideWithFullOpenTagCases(): iterable { return [ [ @@ -141,7 +141,7 @@ function bar() ]; } - public static function provideWithShortOpenTagCases(): array + public static function provideWithShortOpenTagCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpUnit/PhpUnitConstructFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitConstructFixerTest.php index bf3557a4d98..1df48341f9e 100644 --- a/tests/Fixer/PhpUnit/PhpUnitConstructFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitConstructFixerTest.php @@ -48,7 +48,7 @@ public function testFix(string $expected, ?string $input = null): void } } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $cases = [ ['$sth->assertSame(true, $foo);'], @@ -165,7 +165,7 @@ public function testFix73(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFix73Cases(): array + public static function provideFix73Cases(): iterable { return [ [ diff --git a/tests/Fixer/PhpUnit/PhpUnitDedicateAssertFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitDedicateAssertFixerTest.php index 02b19378918..885c6703f3d 100644 --- a/tests/Fixer/PhpUnit/PhpUnitDedicateAssertFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitDedicateAssertFixerTest.php @@ -403,7 +403,7 @@ public function testAssertCountFromSizeOf(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideTestAssertCountCases(): array + public static function provideTestAssertCountCases(): iterable { return [ // positive fixing diff --git a/tests/Fixer/PhpUnit/PhpUnitExpectationFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitExpectationFixerTest.php index cd850e5c412..5e9e4a3a766 100644 --- a/tests/Fixer/PhpUnit/PhpUnitExpectationFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitExpectationFixerTest.php @@ -39,7 +39,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -412,7 +412,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { $expectedTemplate = ' diff --git a/tests/Fixer/PhpUnit/PhpUnitInternalClassFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitInternalClassFixerTest.php index aedf4724f9e..be592ef9143 100644 --- a/tests/Fixer/PhpUnit/PhpUnitInternalClassFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitInternalClassFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'It does not change normal classes' => [ diff --git a/tests/Fixer/PhpUnit/PhpUnitMethodCasingFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitMethodCasingFixerTest.php index 61a4acda006..0f508bcd45b 100644 --- a/tests/Fixer/PhpUnit/PhpUnitMethodCasingFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitMethodCasingFixerTest.php @@ -51,7 +51,7 @@ public function testFixToSnakeCase(string $camelExpected, ?string $camelInput = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'skip non phpunit methods' => [ diff --git a/tests/Fixer/PhpUnit/PhpUnitMockFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitMockFixerTest.php index 8bff1fe867f..a227890ce8e 100644 --- a/tests/Fixer/PhpUnit/PhpUnitMockFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitMockFixerTest.php @@ -38,7 +38,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixerTest.php index f700883a255..f899c72260c 100644 --- a/tests/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitMockShortWillReturnFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'do not fix' => [ diff --git a/tests/Fixer/PhpUnit/PhpUnitNamespacedFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitNamespacedFixerTest.php index b15f74ebdd1..cefc5950848 100644 --- a/tests/Fixer/PhpUnit/PhpUnitNamespacedFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitNamespacedFixerTest.php @@ -38,7 +38,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'class_mapping' => [ diff --git a/tests/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixerTest.php index 0584a202d6d..e5c20c0cf62 100644 --- a/tests/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitNoExpectationAnnotationFixerTest.php @@ -38,7 +38,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'empty exception message' => [ @@ -690,7 +690,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixerTest.php index 8cc4a6e2c27..c770a388d71 100644 --- a/tests/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitSetUpTearDownVisibilityFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'setUp and tearDown are made protected if they are public' => [ diff --git a/tests/Fixer/PhpUnit/PhpUnitSizeClassFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitSizeClassFixerTest.php index 0011d744fe9..df99897c354 100644 --- a/tests/Fixer/PhpUnit/PhpUnitSizeClassFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitSizeClassFixerTest.php @@ -37,7 +37,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'It does not change normal classes' => [ diff --git a/tests/Fixer/PhpUnit/PhpUnitStrictFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitStrictFixerTest.php index 168235b3bef..6dec78fd97b 100644 --- a/tests/Fixer/PhpUnit/PhpUnitStrictFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitStrictFixerTest.php @@ -115,7 +115,7 @@ public function testNoFixWithWrongNumberOfArguments(string $expected): void $this->doTest($expected); } - public static function provideNoFixWithWrongNumberOfArgumentsCases(): array + public static function provideNoFixWithWrongNumberOfArgumentsCases(): iterable { $cases = []; diff --git a/tests/Fixer/PhpUnit/PhpUnitTargetVersionTest.php b/tests/Fixer/PhpUnit/PhpUnitTargetVersionTest.php index 4bbb8b6bcc4..5fcd8ceea10 100644 --- a/tests/Fixer/PhpUnit/PhpUnitTargetVersionTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitTargetVersionTest.php @@ -41,7 +41,7 @@ public function testFulfills(bool $expected, string $candidate, string $target, ); } - public static function provideFulfillsCases(): array + public static function provideFulfillsCases(): iterable { return [ [true, PhpUnitTargetVersion::VERSION_NEWEST, PhpUnitTargetVersion::VERSION_5_6], diff --git a/tests/Fixer/PhpUnit/PhpUnitTestAnnotationFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitTestAnnotationFixerTest.php index 530ee48ce74..225e499c5e9 100644 --- a/tests/Fixer/PhpUnit/PhpUnitTestAnnotationFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitTestAnnotationFixerTest.php @@ -37,7 +37,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'Annotation is used, and it should not be' => [ @@ -1003,7 +1003,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null, ar $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixerTest.php index 3a514618ff6..428ae86091a 100644 --- a/tests/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitTestCaseStaticMethodCallsFixerTest.php @@ -74,7 +74,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixerTest.php b/tests/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixerTest.php index 895e5926c7b..6397c1541d3 100644 --- a/tests/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixerTest.php +++ b/tests/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'already with annotation: @covers' => [ @@ -256,7 +256,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/AlignMultilineCommentFixerTest.php b/tests/Fixer/Phpdoc/AlignMultilineCommentFixerTest.php index cb517bed3ea..f25088c7cfb 100644 --- a/tests/Fixer/Phpdoc/AlignMultilineCommentFixerTest.php +++ b/tests/Fixer/Phpdoc/AlignMultilineCommentFixerTest.php @@ -42,7 +42,7 @@ public function testDefaults(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideDefaultCases(): array + public static function provideDefaultCases(): iterable { return [ [ @@ -180,7 +180,7 @@ public function testDocLikeMultilineComments(string $expected, ?string $input = $this->doTest($expected, $input); } - public static function provideDocLikeMultilineCommentsCases(): array + public static function provideDocLikeMultilineCommentsCases(): iterable { return [ [ @@ -228,7 +228,7 @@ public function testMixedContentMultilineComments(string $expected, ?string $inp $this->doTest($expected, $input); } - public static function provideMixedContentMultilineCommentsCases(): array + public static function provideMixedContentMultilineCommentsCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixerTest.php b/tests/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixerTest.php index 82d316ea32e..442666f0cda 100644 --- a/tests/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixerTest.php +++ b/tests/Fixer/Phpdoc/GeneralPhpdocAnnotationRemoveFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'An Annotation gets removed' => [ diff --git a/tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php b/tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php index 4f2592cfabe..194def9f7f2 100644 --- a/tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php +++ b/tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $configur $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -277,7 +277,7 @@ public function testConfigureWithInvalidReplacements(array $replacements, bool $ ]); } - public static function provideConfigureWithInvalidReplacementsCases(): array + public static function provideConfigureWithInvalidReplacementsCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixerTest.php b/tests/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixerTest.php index 54bcac3aa45..0224f87e270 100644 --- a/tests/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixerTest.php +++ b/tests/Fixer/Phpdoc/NoBlankLinesAfterPhpdocFixerTest.php @@ -324,7 +324,7 @@ public function testInlineTypehintingDocsBeforeFlowBreak(string $expected, ?stri $this->doTest($expected, $input); } - public static function provideInlineTypehintingDocsBeforeFlowBreakCases(): array + public static function provideInlineTypehintingDocsBeforeFlowBreakCases(): iterable { $cases = []; diff --git a/tests/Fixer/Phpdoc/NoEmptyPhpdocFixerTest.php b/tests/Fixer/Phpdoc/NoEmptyPhpdocFixerTest.php index b93e4a79e08..b790033f2f2 100644 --- a/tests/Fixer/Phpdoc/NoEmptyPhpdocFixerTest.php +++ b/tests/Fixer/Phpdoc/NoEmptyPhpdocFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixerTest.php b/tests/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixerTest.php index 7554713f571..ea6eb36e09b 100644 --- a/tests/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocAddMissingParamAnnotationFixerTest.php @@ -99,7 +99,7 @@ public function testFix(string $expected, ?string $input = null, ?array $config $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -381,7 +381,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null, ?a $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ @@ -400,7 +400,7 @@ public function testByReference(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideByReferenceCases(): array + public static function provideByReferenceCases(): iterable { return [ [ @@ -445,7 +445,7 @@ public function testVariableNumberOfArguments(string $expected, string $input): $this->doTest($expected, $input); } - public static function provideVariableNumberOfArgumentsCases(): array + public static function provideVariableNumberOfArgumentsCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixerTest.php b/tests/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixerTest.php index 45053580413..ae82a2c3e61 100644 --- a/tests/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocAnnotationWithoutDotFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocIndentFixerTest.php b/tests/Fixer/Phpdoc/PhpdocIndentFixerTest.php index 324761c288a..37d5cb71617 100644 --- a/tests/Fixer/Phpdoc/PhpdocIndentFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocIndentFixerTest.php @@ -33,7 +33,7 @@ public function testFixIndent(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixIndentCases(): array + public static function provideFixIndentCases(): iterable { $cases = []; diff --git a/tests/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixerTest.php b/tests/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixerTest.php index 98fae302979..cb4a1d11380 100644 --- a/tests/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocInlineTagNormalizerFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null, array $configur $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $cases = [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocLineSpanFixerTest.php b/tests/Fixer/Phpdoc/PhpdocLineSpanFixerTest.php index 65c363c02bc..f75110603be 100644 --- a/tests/Fixer/Phpdoc/PhpdocLineSpanFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocLineSpanFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'It does not change doc blocks if not needed' => [ diff --git a/tests/Fixer/Phpdoc/PhpdocNoAliasTagFixerTest.php b/tests/Fixer/Phpdoc/PhpdocNoAliasTagFixerTest.php index 556cd4f11ca..6b31d5170fc 100644 --- a/tests/Fixer/Phpdoc/PhpdocNoAliasTagFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocNoAliasTagFixerTest.php @@ -99,7 +99,7 @@ public function testPropertyFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function providePropertyFixCases(): array + public static function providePropertyFixCases(): iterable { return [ [ @@ -137,7 +137,7 @@ public function testTypeToVarFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideTypeToVarFixCases(): array + public static function provideTypeToVarFixCases(): iterable { return [ [ @@ -195,7 +195,7 @@ public function testVarToTypeFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideVarToTypeFixCases(): array + public static function provideVarToTypeFixCases(): iterable { return [ [ @@ -261,7 +261,7 @@ public function testDefaultConfig(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideDefaultConfigCases(): array + public static function provideDefaultConfigCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixerTest.php b/tests/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixerTest.php index 222eda93102..0c9c9f5e890 100644 --- a/tests/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocNoUselessInheritdocFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocOrderByValueFixerTest.php b/tests/Fixer/Phpdoc/PhpdocOrderByValueFixerTest.php index 112a80e2bf3..ce881bc5209 100644 --- a/tests/Fixer/Phpdoc/PhpdocOrderByValueFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocOrderByValueFixerTest.php @@ -43,7 +43,7 @@ public function testConfigureRejectsInvalidControlStatement($annotation): void ]); } - public static function provideConfigureRejectsInvalidControlStatementCases(): array + public static function provideConfigureRejectsInvalidControlStatementCases(): iterable { return [ 'null' => [null], @@ -79,7 +79,7 @@ public function testFixWithAuthor(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithAuthorCases(): array + public static function provideFixWithAuthorCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -199,7 +199,7 @@ public function testFixWithCovers(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCoversCases(): array + public static function provideFixWithCoversCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -319,7 +319,7 @@ public function testFixWithCoversNothing(string $expected, ?string $input = null $this->doTest($expected, $input); } - public static function provideFixWithCoversNothingCases(): array + public static function provideFixWithCoversNothingCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -439,7 +439,7 @@ public function testFixWithDataProvider(string $expected, ?string $input = null) $this->doTest($expected, $input); } - public static function provideFixWithDataProviderCases(): array + public static function provideFixWithDataProviderCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -559,7 +559,7 @@ public function testFixWithDepends(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithDependsCases(): array + public static function provideFixWithDependsCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -679,7 +679,7 @@ public function testFixWithGroup(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithGroupCases(): array + public static function provideFixWithGroupCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -799,7 +799,7 @@ public function testFixWithInternal(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithInternalCases(): array + public static function provideFixWithInternalCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -919,7 +919,7 @@ public function testFixWithMethod(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithMethodCases(): array + public static function provideFixWithMethodCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1043,7 +1043,7 @@ public function testFixWithMixin(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithMixinCases(): array + public static function provideFixWithMixinCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1165,7 +1165,7 @@ public function testFixWithProperty(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithPropertyCases(): array + public static function provideFixWithPropertyCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1273,7 +1273,7 @@ public function testFixWithPropertyRead(string $expected, ?string $input = null) $this->doTest($expected, $input); } - public static function provideFixWithPropertyReadCases(): array + public static function provideFixWithPropertyReadCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1381,7 +1381,7 @@ public function testFixWithPropertyWrite(string $expected, ?string $input = null $this->doTest($expected, $input); } - public static function provideFixWithPropertyWriteCases(): array + public static function provideFixWithPropertyWriteCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1489,7 +1489,7 @@ public function testFixWithRequires(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithRequiresCases(): array + public static function provideFixWithRequiresCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1609,7 +1609,7 @@ public function testFixWithThrows(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithThrowsCases(): array + public static function provideFixWithThrowsCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1745,7 +1745,7 @@ public function testFixWithUses(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithUsesCases(): array + public static function provideFixWithUsesCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ @@ -1866,7 +1866,7 @@ public function testFixWithMultipleConfiguredAnnotations(string $expected, ?stri $this->doTest($expected, $input); } - public static function provideFixWithMultipleConfiguredAnnotationsCases(): array + public static function provideFixWithMultipleConfiguredAnnotationsCases(): iterable { return [ 'skip on 1 or 0 occurrences' => [ diff --git a/tests/Fixer/Phpdoc/PhpdocOrderFixerTest.php b/tests/Fixer/Phpdoc/PhpdocOrderFixerTest.php index d486e2da1dc..fb0e8dc4d2d 100644 --- a/tests/Fixer/Phpdoc/PhpdocOrderFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocOrderFixerTest.php @@ -387,7 +387,7 @@ public function testExampleFromSymfonyWithLaravelStyle(): void /** * @return array[][] */ - public static function provideDifferentOrderCases(): array + public static function provideDifferentOrderCases(): iterable { return [ [['order' => ['param', 'throw', 'return']]], @@ -410,7 +410,7 @@ public function testFixBasicCaseWithDifferentOrders(array $config, string $expec /** * @return array|string>> */ - public static function provideFixBasicCaseWithDifferentOrdersCases(): array + public static function provideFixBasicCaseWithDifferentOrdersCases(): iterable { $input = <<<'EOF' > */ - public static function provideFixCompleteCasesWithCustomOrdersCases(): array + public static function provideFixCompleteCasesWithCustomOrdersCases(): iterable { return [ 'intepacuthre' => [ diff --git a/tests/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixerTest.php b/tests/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixerTest.php index 5ba2d6c8211..730b378c833 100644 --- a/tests/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocReturnSelfReferenceFixerTest.php @@ -33,7 +33,7 @@ public function testFixWithDefaultConfiguration(string $expected, ?string $input $this->doTest($expected, $input); } - public static function provideFixWithDefaultConfigurationCases(): array + public static function provideFixWithDefaultConfigurationCases(): iterable { return [ [ @@ -88,7 +88,7 @@ public function testFix(string $expected, ?string $input = null, array $configur $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -146,7 +146,7 @@ public function AB($self) $this->doTest($expected, $input); } - public static function provideGeneratedFixCases(): array + public static function provideGeneratedFixCases(): iterable { return [ ['$this', 'this'], @@ -171,7 +171,7 @@ public function testInvalidConfiguration(array $configuration, string $message): $this->fixer->configure($configuration); } - public static function provideInvalidConfigurationCases(): array + public static function provideInvalidConfigurationCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocSeparationFixerTest.php b/tests/Fixer/Phpdoc/PhpdocSeparationFixerTest.php index af396836ba9..a4d911fbfa7 100644 --- a/tests/Fixer/Phpdoc/PhpdocSeparationFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocSeparationFixerTest.php @@ -536,7 +536,7 @@ public function testInheritDoc(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideInheritDocCases(): array + public static function provideInheritDocCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixerTest.php b/tests/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixerTest.php index 6ecc71da8a2..404adcb5228 100644 --- a/tests/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocSingleLineVarSpacingFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocSummaryFixerTest.php b/tests/Fixer/Phpdoc/PhpdocSummaryFixerTest.php index 7a0706ae3ec..bf1b3593bde 100644 --- a/tests/Fixer/Phpdoc/PhpdocSummaryFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocSummaryFixerTest.php @@ -367,7 +367,7 @@ public function testWithInheritDoc(string $expected): void $this->doTest($expected); } - public static function provideWithInheritDocCases(): array + public static function provideWithInheritDocCases(): iterable { return [ [ @@ -410,7 +410,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocTagCasingFixerTest.php b/tests/Fixer/Phpdoc/PhpdocTagCasingFixerTest.php index 28f717fc686..9b13a5c8488 100644 --- a/tests/Fixer/Phpdoc/PhpdocTagCasingFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocTagCasingFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php b/tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php index 515bdc4cd5d..d5a603b754f 100644 --- a/tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocTagTypeFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $configur $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php b/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php index da736c42c44..b38178d7434 100644 --- a/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocToCommentFixerTest.php @@ -687,7 +687,7 @@ public function b() ]; } - public static function provideTraitsCases(): array + public static function provideTraitsCases(): iterable { return [ [ @@ -705,7 +705,7 @@ public function test() {} ]; } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixerTest.php b/tests/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixerTest.php index c034882ed8a..49904a3c61d 100644 --- a/tests/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocTrimConsecutiveBlankLineSeparationFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'no changes' => ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocTypesOrderFixerTest.php b/tests/Fixer/Phpdoc/PhpdocTypesOrderFixerTest.php index c1415211202..91e6296cc96 100644 --- a/tests/Fixer/Phpdoc/PhpdocTypesOrderFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocTypesOrderFixerTest.php @@ -44,7 +44,7 @@ public function testFixWithNullFirst(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideFixWithNullFirstCases(): array + public static function provideFixWithNullFirstCases(): iterable { return [ [ @@ -198,7 +198,7 @@ public function testFixWithNullLast(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithNullLastCases(): array + public static function provideFixWithNullLastCases(): iterable { return [ [ @@ -317,7 +317,7 @@ public function testFixWithAlphaAlgorithm(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideFixWithAlphaAlgorithmCases(): array + public static function provideFixWithAlphaAlgorithmCases(): iterable { return [ [ @@ -447,7 +447,7 @@ public function testFixWithAlphaAlgorithmAndNullAlwaysFirst(string $expected, ?s $this->doTest($expected, $input); } - public static function provideFixWithAlphaAlgorithmAndNullAlwaysFirstCases(): array + public static function provideFixWithAlphaAlgorithmAndNullAlwaysFirstCases(): iterable { return [ [ @@ -562,7 +562,7 @@ public function testFixWithAlphaAlgorithmAndNullAlwaysLast(string $expected, ?st $this->doTest($expected, $input); } - public static function provideFixWithAlphaAlgorithmAndNullAlwaysLastCases(): array + public static function provideFixWithAlphaAlgorithmAndNullAlwaysLastCases(): iterable { return [ [ diff --git a/tests/Fixer/Phpdoc/PhpdocVarWithoutNameFixerTest.php b/tests/Fixer/Phpdoc/PhpdocVarWithoutNameFixerTest.php index 94fc021329d..19e5996e3e3 100644 --- a/tests/Fixer/Phpdoc/PhpdocVarWithoutNameFixerTest.php +++ b/tests/Fixer/Phpdoc/PhpdocVarWithoutNameFixerTest.php @@ -46,7 +46,7 @@ public function testFixType(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixVarCases(): array + public static function provideFixVarCases(): iterable { return [ 'testFixVar' => [ diff --git a/tests/Fixer/ReturnNotation/NoUselessReturnFixerTest.php b/tests/Fixer/ReturnNotation/NoUselessReturnFixerTest.php index 2406fd05201..012b3020492 100644 --- a/tests/Fixer/ReturnNotation/NoUselessReturnFixerTest.php +++ b/tests/Fixer/ReturnNotation/NoUselessReturnFixerTest.php @@ -31,7 +31,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/ReturnNotation/ReturnAssignmentFixerTest.php b/tests/Fixer/ReturnNotation/ReturnAssignmentFixerTest.php index a17c7524e5f..13383edd281 100644 --- a/tests/Fixer/ReturnNotation/ReturnAssignmentFixerTest.php +++ b/tests/Fixer/ReturnNotation/ReturnAssignmentFixerTest.php @@ -31,7 +31,7 @@ public function testFixNestedFunctions(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFixNestedFunctionsCases(): array + public static function provideFixNestedFunctionsCases(): iterable { return [ [ @@ -191,7 +191,7 @@ public function testFix(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -803,7 +803,7 @@ public function testDoNotFix(string $expected): void $this->doTest($expected); } - public static function provideDoNotFixCases(): array + public static function provideDoNotFixCases(): iterable { return [ 'invalid reference stays invalid' => [ diff --git a/tests/Fixer/ReturnNotation/SimplifiedNullReturnFixerTest.php b/tests/Fixer/ReturnNotation/SimplifiedNullReturnFixerTest.php index a1286489580..d26c18a738a 100644 --- a/tests/Fixer/ReturnNotation/SimplifiedNullReturnFixerTest.php +++ b/tests/Fixer/ReturnNotation/SimplifiedNullReturnFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ // check correct statements aren't changed diff --git a/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php b/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php index 610969b7aa4..b406d04024a 100644 --- a/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php +++ b/tests/Fixer/Semicolon/MultilineWhitespaceBeforeSemicolonsFixerTest.php @@ -39,7 +39,7 @@ public function testFixMultiLineWhitespace(string $expected, ?string $input = nu $this->doTest($expected, $input); } - public static function provideFixMultiLineWhitespaceCases(): array + public static function provideFixMultiLineWhitespaceCases(): iterable { return [ [ @@ -263,7 +263,7 @@ public function testMessyWhitespacesMultiLineWhitespace(string $expected, ?strin $this->doTest($expected, $input); } - public static function provideMessyWhitespacesMultiLineWhitespaceCases(): array + public static function provideMessyWhitespacesMultiLineWhitespaceCases(): iterable { return [ [ @@ -282,7 +282,7 @@ public function testSemicolonForChainedCallsFix(string $expected, ?string $input $this->doTest($expected, $input); } - public static function provideSemicolonForChainedCallsFixCases(): array + public static function provideSemicolonForChainedCallsFixCases(): iterable { return [ [ @@ -1085,7 +1085,7 @@ public function testMessyWhitespacesSemicolonForChainedCalls(string $expected, ? $this->doTest($expected, $input); } - public static function provideMessyWhitespacesSemicolonForChainedCallsCases(): array + public static function provideMessyWhitespacesSemicolonForChainedCallsCases(): iterable { return [ [ diff --git a/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php b/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php index f00bf08dced..c8553835559 100644 --- a/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php +++ b/tests/Fixer/Semicolon/NoEmptyStatementFixerTest.php @@ -433,7 +433,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -528,7 +528,7 @@ public function testCasesWithShortOpenTag(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideCasesWithShortOpenTagCases(): array + public static function provideCasesWithShortOpenTagCases(): iterable { return [ [ @@ -546,7 +546,7 @@ public function testFixMultipleSemicolons(string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideFixMultipleSemicolonsCases(): array + public static function provideFixMultipleSemicolonsCases(): iterable { return [ [ diff --git a/tests/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixerTest.php b/tests/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixerTest.php index 5be5d8cb9db..aea99a4dfea 100644 --- a/tests/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixerTest.php +++ b/tests/Fixer/Semicolon/NoSinglelineWhitespaceBeforeSemicolonsFixerTest.php @@ -35,7 +35,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Semicolon/SpaceAfterSemicolonFixerTest.php b/tests/Fixer/Semicolon/SpaceAfterSemicolonFixerTest.php index c11733ce53f..69a0caded5e 100644 --- a/tests/Fixer/Semicolon/SpaceAfterSemicolonFixerTest.php +++ b/tests/Fixer/Semicolon/SpaceAfterSemicolonFixerTest.php @@ -42,7 +42,7 @@ public function testFixWithSpacesInEmptyForExpressions(string $expected, ?string $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -290,7 +290,7 @@ public function testFixWithoutSpacesInEmptyForExpressions(string $expected, ?str $this->doTest($expected, $input); } - public static function provideFixWithoutSpacesInEmptyForExpressionsCases(): array + public static function provideFixWithoutSpacesInEmptyForExpressionsCases(): iterable { return [ [ diff --git a/tests/Fixer/Strict/DeclareStrictTypesFixerTest.php b/tests/Fixer/Strict/DeclareStrictTypesFixerTest.php index 386027a140d..925b612b6a3 100644 --- a/tests/Fixer/Strict/DeclareStrictTypesFixerTest.php +++ b/tests/Fixer/Strict/DeclareStrictTypesFixerTest.php @@ -32,7 +32,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -129,7 +129,7 @@ public function testDoNotFix(string $input): void $this->doTest($input); } - public static function provideDoNotFixCases(): array + public static function provideDoNotFixCases(): iterable { return [ [' doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/Strict/StrictComparisonFixerTest.php b/tests/Fixer/Strict/StrictComparisonFixerTest.php index 74a00da5901..1f13634d880 100644 --- a/tests/Fixer/Strict/StrictComparisonFixerTest.php +++ b/tests/Fixer/Strict/StrictComparisonFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/StringNotation/EscapeImplicitBackslashesFixerTest.php b/tests/Fixer/StringNotation/EscapeImplicitBackslashesFixerTest.php index 4eefda19015..b123b30f6d7 100644 --- a/tests/Fixer/StringNotation/EscapeImplicitBackslashesFixerTest.php +++ b/tests/Fixer/StringNotation/EscapeImplicitBackslashesFixerTest.php @@ -36,7 +36,7 @@ public function testFix(string $expected, ?string $input = null, array $configur $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/StringNotation/ExplicitStringVariableFixerTest.php b/tests/Fixer/StringNotation/ExplicitStringVariableFixerTest.php index ffa3de0a219..6310eb73b55 100644 --- a/tests/Fixer/StringNotation/ExplicitStringVariableFixerTest.php +++ b/tests/Fixer/StringNotation/ExplicitStringVariableFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $input = $expected = 'doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [<<<'EOF' diff --git a/tests/Fixer/StringNotation/NoBinaryStringFixerTest.php b/tests/Fixer/StringNotation/NoBinaryStringFixerTest.php index fb21da1757c..daf7e8a27ed 100644 --- a/tests/Fixer/StringNotation/NoBinaryStringFixerTest.php +++ b/tests/Fixer/StringNotation/NoBinaryStringFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/StringNotation/SimpleToComplexStringVariableFixerTest.php b/tests/Fixer/StringNotation/SimpleToComplexStringVariableFixerTest.php index a425625cbf2..4f485fbe84b 100644 --- a/tests/Fixer/StringNotation/SimpleToComplexStringVariableFixerTest.php +++ b/tests/Fixer/StringNotation/SimpleToComplexStringVariableFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'basic fix' => [ diff --git a/tests/Fixer/StringNotation/SingleQuoteFixerTest.php b/tests/Fixer/StringNotation/SingleQuoteFixerTest.php index eb3ce99cf09..c1583d0c8a2 100644 --- a/tests/Fixer/StringNotation/SingleQuoteFixerTest.php +++ b/tests/Fixer/StringNotation/SingleQuoteFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -133,7 +133,7 @@ public function testSingleQuoteFix(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideSingleQuoteFixCases(): array + public static function provideSingleQuoteFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/ArrayIndentationFixerTest.php b/tests/Fixer/Whitespace/ArrayIndentationFixerTest.php index 4568d2af22f..db90b7c86a5 100644 --- a/tests/Fixer/Whitespace/ArrayIndentationFixerTest.php +++ b/tests/Fixer/Whitespace/ArrayIndentationFixerTest.php @@ -32,7 +32,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return self::withLongArraySyntaxCases([ [ @@ -863,7 +863,7 @@ public function testFixWithTabs(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithTabsCases(): array + public static function provideFixWithTabsCases(): iterable { return self::withLongArraySyntaxCases([ [ diff --git a/tests/Fixer/Whitespace/BlankLineBeforeStatementFixerTest.php b/tests/Fixer/Whitespace/BlankLineBeforeStatementFixerTest.php index 0977cc80cb5..85127a01506 100644 --- a/tests/Fixer/Whitespace/BlankLineBeforeStatementFixerTest.php +++ b/tests/Fixer/Whitespace/BlankLineBeforeStatementFixerTest.php @@ -42,7 +42,7 @@ public function testConfigureRejectsInvalidControlStatement($controlStatement): ]); } - public static function provideConfigureRejectsInvalidControlStatementCases(): array + public static function provideConfigureRejectsInvalidControlStatementCases(): iterable { return [ 'null' => [null], @@ -76,7 +76,7 @@ public function testFixWithBreak(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithBreakCases(): array + public static function provideFixWithBreakCases(): iterable { return [ [ @@ -175,7 +175,7 @@ public function testFixWithCase(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithCaseCases(): array + public static function provideFixWithCaseCases(): iterable { return [ [ @@ -215,7 +215,7 @@ public function testFixWithContinue(string $expected, ?string $input = null): vo $this->doTest($expected, $input); } - public static function provideFixWithContinueCases(): array + public static function provideFixWithContinueCases(): iterable { return [ [ @@ -307,7 +307,7 @@ public function testFixWithDeclare(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithDeclareCases(): array + public static function provideFixWithDeclareCases(): iterable { return [ [ @@ -344,7 +344,7 @@ public function testFixWithDefault(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithDefaultCases(): array + public static function provideFixWithDefaultCases(): iterable { return [ [ @@ -389,7 +389,7 @@ public function testFixWithDo(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithDoCases(): array + public static function provideFixWithDoCases(): iterable { return [ [ @@ -423,7 +423,7 @@ public function testFixWithExit(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithExitCases(): array + public static function provideFixWithExitCases(): iterable { return [ [ @@ -479,7 +479,7 @@ public function testFixWithFor(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithForCases(): array + public static function provideFixWithForCases(): iterable { return [ [ @@ -508,7 +508,7 @@ public function testFixWithGoto(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithGotoCases(): array + public static function provideFixWithGotoCases(): iterable { return [ [ @@ -561,7 +561,7 @@ public function testFixWithIf(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithIfCases(): array + public static function provideFixWithIfCases(): iterable { return [ [ @@ -608,7 +608,7 @@ public function testFixWithForEach(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithForEachCases(): array + public static function provideFixWithForEachCases(): iterable { return [ [ @@ -637,7 +637,7 @@ public function testFixWithInclude(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithIncludeCases(): array + public static function provideFixWithIncludeCases(): iterable { return [ [ @@ -668,7 +668,7 @@ public function testFixWithIncludeOnce(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithIncludeOnceCases(): array + public static function provideFixWithIncludeOnceCases(): iterable { return [ [ @@ -699,7 +699,7 @@ public function testFixWithRequire(string $expected, ?string $input = null): voi $this->doTest($expected, $input); } - public static function provideFixWithRequireCases(): array + public static function provideFixWithRequireCases(): iterable { return [ [ @@ -730,7 +730,7 @@ public function testFixWithRequireOnce(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideFixWithRequireOnceCases(): array + public static function provideFixWithRequireOnceCases(): iterable { return [ [ @@ -761,7 +761,7 @@ public function testFixWithReturn(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithReturnCases(): array + public static function provideFixWithReturnCases(): iterable { return [ [ @@ -903,7 +903,7 @@ public function testFixWithReturnAndMessyWhitespaces(string $expected, ?string $ $this->doTest($expected, $input); } - public static function provideFixWithReturnAndMessyWhitespacesCases(): array + public static function provideFixWithReturnAndMessyWhitespacesCases(): iterable { return [ [ @@ -933,7 +933,7 @@ public function testFixWithSwitch(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithSwitchCases(): array + public static function provideFixWithSwitchCases(): iterable { return [ [ @@ -973,7 +973,7 @@ public function testFixWithThrow(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithThrowCases(): array + public static function provideFixWithThrowCases(): iterable { return [ [ @@ -1010,7 +1010,7 @@ public function testFixWithTry(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithTryCases(): array + public static function provideFixWithTryCases(): iterable { return [ [ @@ -1053,7 +1053,7 @@ public function testFixWithWhile(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixWithWhileCases(): array + public static function provideFixWithWhileCases(): iterable { return [ [ @@ -1112,7 +1112,7 @@ public function testFixWithYield(string $expected, ?string $input = null): void /** * @yield array */ - public static function provideFixWithYieldCases(): array + public static function provideFixWithYieldCases(): iterable { return [ [ @@ -1234,7 +1234,7 @@ public function testFixWithYieldFrom(string $expected, ?string $input = null): v /** * @yield array */ - public static function provideFixWithYieldFromCases(): array + public static function provideFixWithYieldFromCases(): iterable { return [ [ @@ -1294,7 +1294,7 @@ public function testFixWithMultipleConfigStatements(array $statements, string $e $this->doTest($expected, $input); } - public static function provideFixWithMultipleConfigStatementsCases(): array + public static function provideFixWithMultipleConfigStatementsCases(): iterable { $statementsWithoutCaseOrDefault = [ 'break', diff --git a/tests/Fixer/Whitespace/CompactNullableTypehintFixerTest.php b/tests/Fixer/Whitespace/CompactNullableTypehintFixerTest.php index 6f35ecd83fe..fa007767d13 100644 --- a/tests/Fixer/Whitespace/CompactNullableTypehintFixerTest.php +++ b/tests/Fixer/Whitespace/CompactNullableTypehintFixerTest.php @@ -33,7 +33,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/HeredocIndentationFixerTest.php b/tests/Fixer/Whitespace/HeredocIndentationFixerTest.php index c704f606c46..d3fd201e14c 100644 --- a/tests/Fixer/Whitespace/HeredocIndentationFixerTest.php +++ b/tests/Fixer/Whitespace/HeredocIndentationFixerTest.php @@ -37,7 +37,7 @@ public function testFix(string $expected, ?string $input = null, array $config = $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/IndentationTypeFixerTest.php b/tests/Fixer/Whitespace/IndentationTypeFixerTest.php index ff5929c7dc1..e184d1660b7 100644 --- a/tests/Fixer/Whitespace/IndentationTypeFixerTest.php +++ b/tests/Fixer/Whitespace/IndentationTypeFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $cases = []; @@ -233,7 +233,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { $cases = []; @@ -307,7 +307,7 @@ public function testMessyWhitespacesReversed(string $expected, ?string $input = $this->doTest($input, $expected); } - public static function provideMessyWhitespacesReversedCases(): array + public static function provideMessyWhitespacesReversedCases(): iterable { return array_filter( self::provideMessyWhitespacesCases(), @@ -328,7 +328,7 @@ public function testDoubleSpaceIndent(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideDoubleSpaceIndentCases(): array + public static function provideDoubleSpaceIndentCases(): iterable { return [ ['doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { $cases = self::provideCommonCases(); diff --git a/tests/Fixer/Whitespace/MethodChainingIndentationFixerTest.php b/tests/Fixer/Whitespace/MethodChainingIndentationFixerTest.php index 69968bcbc8d..8df0f768ba4 100644 --- a/tests/Fixer/Whitespace/MethodChainingIndentationFixerTest.php +++ b/tests/Fixer/Whitespace/MethodChainingIndentationFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -444,7 +444,7 @@ public function testWindowsWhitespaces(string $expected, ?string $input = null): $this->doTest($expected, $input); } - public static function provideWindowsWhitespacesCases(): array + public static function provideWindowsWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/NoExtraBlankLinesFixerTest.php b/tests/Fixer/Whitespace/NoExtraBlankLinesFixerTest.php index b76bcda0a26..a378f115d20 100644 --- a/tests/Fixer/Whitespace/NoExtraBlankLinesFixerTest.php +++ b/tests/Fixer/Whitespace/NoExtraBlankLinesFixerTest.php @@ -366,7 +366,7 @@ public function testFixWithComments(string $expected, string $input): void $this->doTest($expected, $input); } - public static function provideFixWithCommentsCases(): array + public static function provideFixWithCommentsCases(): iterable { return [ [ @@ -565,7 +565,7 @@ public function testRemoveLinesBetweenUseStatements(string $expected, ?string $i $this->doTest($expected, $input); } - public static function provideRemoveLinesBetweenUseStatementsCases(): array + public static function provideRemoveLinesBetweenUseStatementsCases(): iterable { return [ [ @@ -834,7 +834,7 @@ public function testBraces(array $config, string $expected, ?string $input = nul $this->doTest($expected, $input); } - public static function provideBracesCases(): array + public static function provideBracesCases(): iterable { return [ [ @@ -974,7 +974,7 @@ public function testInSwitchStatement(array $config, string $expected, ?string $ $this->doTest($expected, $input); } - public static function provideInSwitchStatementCases(): array + public static function provideInSwitchStatementCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/NoSpacesAroundOffsetFixerTest.php b/tests/Fixer/Whitespace/NoSpacesAroundOffsetFixerTest.php index 3cec67974dd..b2f62566e27 100644 --- a/tests/Fixer/Whitespace/NoSpacesAroundOffsetFixerTest.php +++ b/tests/Fixer/Whitespace/NoSpacesAroundOffsetFixerTest.php @@ -72,7 +72,7 @@ public function testComments(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideCommentsCases(): array + public static function provideCommentsCases(): iterable { return [ [ @@ -206,7 +206,7 @@ public static function provideFixSpaceOutsideOffsetCases(): iterable } } - public static function provideFixSpaceInsideOffsetCases(): array + public static function provideFixSpaceInsideOffsetCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/NoSpacesInsideParenthesisFixerTest.php b/tests/Fixer/Whitespace/NoSpacesInsideParenthesisFixerTest.php index dfe35e8aede..e6f1e964d0b 100644 --- a/tests/Fixer/Whitespace/NoSpacesInsideParenthesisFixerTest.php +++ b/tests/Fixer/Whitespace/NoSpacesInsideParenthesisFixerTest.php @@ -56,7 +56,7 @@ private function bar() $this->doTest($expected); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/NoWhitespaceInBlankLineFixerTest.php b/tests/Fixer/Whitespace/NoWhitespaceInBlankLineFixerTest.php index 4a1cb868621..9ce9dc945b2 100644 --- a/tests/Fixer/Whitespace/NoWhitespaceInBlankLineFixerTest.php +++ b/tests/Fixer/Whitespace/NoWhitespaceInBlankLineFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [ @@ -152,7 +152,7 @@ public function testMessyWhitespaces(string $expected, ?string $input = null): v $this->doTest($expected, $input); } - public static function provideMessyWhitespacesCases(): array + public static function provideMessyWhitespacesCases(): iterable { return [ [ diff --git a/tests/Fixer/Whitespace/SingleBlankLineAtEofFixerTest.php b/tests/Fixer/Whitespace/SingleBlankLineAtEofFixerTest.php index aaee5ecad26..d8741d28600 100644 --- a/tests/Fixer/Whitespace/SingleBlankLineAtEofFixerTest.php +++ b/tests/Fixer/Whitespace/SingleBlankLineAtEofFixerTest.php @@ -34,7 +34,7 @@ public function testFix(string $expected, ?string $input = null): void $this->doTest($expected, $input); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ 'Not adding an empty line in empty file.' => [ diff --git a/tests/FixerConfiguration/AliasedFixerOptionTest.php b/tests/FixerConfiguration/AliasedFixerOptionTest.php index 70372f7a9bd..ca405e9b6a5 100644 --- a/tests/FixerConfiguration/AliasedFixerOptionTest.php +++ b/tests/FixerConfiguration/AliasedFixerOptionTest.php @@ -37,7 +37,7 @@ public function testGetName(string $name): void self::assertSame($name, $option->getName()); } - public static function provideGetNameCases(): array + public static function provideGetNameCases(): iterable { return [ ['foo'], @@ -55,7 +55,7 @@ public function testGetDescription(string $description): void self::assertSame($description, $option->getDescription()); } - public static function provideGetDescriptionCases(): array + public static function provideGetDescriptionCases(): iterable { return [ ['Foo.'], @@ -71,7 +71,7 @@ public function testHasDefault(bool $hasDefault, AliasedFixerOption $input): voi self::assertSame($hasDefault, $input->hasDefault()); } - public static function provideHasDefaultCases(): array + public static function provideHasDefaultCases(): iterable { return [ [ @@ -95,7 +95,7 @@ public function testGetDefault(string $default): void self::assertSame($default, $option->getDefault()); } - public static function provideGetDefaultCases(): array + public static function provideGetDefaultCases(): iterable { return [ ['baz'], @@ -124,7 +124,7 @@ public function testGetAllowedTypes(?array $allowedTypes): void self::assertSame($allowedTypes, $option->getAllowedTypes()); } - public static function provideGetAllowedTypesCases(): array + public static function provideGetAllowedTypesCases(): iterable { return [ [null], @@ -145,7 +145,7 @@ public function testGetAllowedValues(?array $allowedValues): void self::assertSame($allowedValues, $option->getAllowedValues()); } - public static function provideGetAllowedValuesCases(): array + public static function provideGetAllowedValuesCases(): iterable { return [ [null], @@ -183,7 +183,7 @@ public function testGetAlias(string $alias): void self::assertSame($alias, $options->getAlias()); } - public static function provideGetAliasCases(): array + public static function provideGetAliasCases(): iterable { return [ ['bar'], diff --git a/tests/FixerConfiguration/AllowedValueSubsetTest.php b/tests/FixerConfiguration/AllowedValueSubsetTest.php index 90195165315..486f4a7e434 100644 --- a/tests/FixerConfiguration/AllowedValueSubsetTest.php +++ b/tests/FixerConfiguration/AllowedValueSubsetTest.php @@ -67,7 +67,7 @@ public function testInvoke($inputValue, bool $expectedResult): void self::assertSame($expectedResult, $subset($inputValue)); } - public static function provideInvokeCases(): array + public static function provideInvokeCases(): iterable { return [ [ diff --git a/tests/FixerConfiguration/DeprecatedFixerOptionTest.php b/tests/FixerConfiguration/DeprecatedFixerOptionTest.php index 860e18b2409..0aacee9e81f 100644 --- a/tests/FixerConfiguration/DeprecatedFixerOptionTest.php +++ b/tests/FixerConfiguration/DeprecatedFixerOptionTest.php @@ -71,7 +71,7 @@ public function testHasDefault(bool $isRequired): void self::assertSame(!$isRequired, $option->hasDefault()); } - public static function provideHasDefaultCases(): array + public static function provideHasDefaultCases(): iterable { return [ [true], @@ -94,7 +94,7 @@ public function testGetDefault($default): void self::assertSame($default, $option->getDefault()); } - public static function provideGetDefaultCases(): array + public static function provideGetDefaultCases(): iterable { return [ ['foo'], diff --git a/tests/FixerDefinition/VersionSpecificCodeSampleTest.php b/tests/FixerDefinition/VersionSpecificCodeSampleTest.php index 94d2bb22abe..d1e5e4af027 100644 --- a/tests/FixerDefinition/VersionSpecificCodeSampleTest.php +++ b/tests/FixerDefinition/VersionSpecificCodeSampleTest.php @@ -75,7 +75,7 @@ public function testIsSuitableForUsesVersionSpecification(int $version, bool $is self::assertSame($isSatisfied, $codeSample->isSuitableFor($version)); } - public static function provideIsSuitableForUsesVersionSpecificationCases(): array + public static function provideIsSuitableForUsesVersionSpecificationCases(): iterable { return [ 'is-satisfied' => [\PHP_VERSION_ID, true], diff --git a/tests/FixerDefinition/VersionSpecificationTest.php b/tests/FixerDefinition/VersionSpecificationTest.php index 778350a8853..a61614878d2 100644 --- a/tests/FixerDefinition/VersionSpecificationTest.php +++ b/tests/FixerDefinition/VersionSpecificationTest.php @@ -56,7 +56,7 @@ public function testConstructorRejectsInvalidMaximum(int $maximum): void ); } - public static function provideInvalidVersionCases(): array + public static function provideInvalidVersionCases(): iterable { return [ 'negative' => [-1], @@ -87,7 +87,7 @@ public function testIsSatisfiedByReturnsTrue(?int $minimum, ?int $maximum, int $ self::assertTrue($versionSpecification->isSatisfiedBy($actual)); } - public static function provideIsSatisfiedByReturnsTrueCases(): array + public static function provideIsSatisfiedByReturnsTrueCases(): iterable { return [ 'version-same-as-maximum' => [null, \PHP_VERSION_ID, \PHP_VERSION_ID], @@ -110,7 +110,7 @@ public function testIsSatisfiedByReturnsFalse(?int $minimum, ?int $maximum, int self::assertFalse($versionSpecification->isSatisfiedBy($actual)); } - public static function provideIsSatisfiedByReturnsFalseCases(): array + public static function provideIsSatisfiedByReturnsFalseCases(): iterable { return [ 'version-greater-than-maximum' => [null, \PHP_VERSION_ID, \PHP_VERSION_ID + 1], diff --git a/tests/FixerFactoryTest.php b/tests/FixerFactoryTest.php index 7811dc7df20..8a139d1c590 100644 --- a/tests/FixerFactoryTest.php +++ b/tests/FixerFactoryTest.php @@ -273,7 +273,7 @@ public function testConflictingFixers(RuleSet $ruleSet): void ; } - public static function provideConflictingFixersCases(): array + public static function provideConflictingFixersCases(): iterable { return [ [new RuleSet(['no_blank_lines_before_namespace' => true, 'single_blank_line_before_namespace' => true])], @@ -371,7 +371,7 @@ public function testConfigureFixerWithNonArray($value): void ])); } - public static function provideConfigureFixerWithNonArrayCases(): array + public static function provideConfigureFixerWithNonArrayCases(): iterable { return [ ['bar'], diff --git a/tests/FixerNameValidatorTest.php b/tests/FixerNameValidatorTest.php index 194085eb98e..8edf2bf8fc3 100644 --- a/tests/FixerNameValidatorTest.php +++ b/tests/FixerNameValidatorTest.php @@ -35,7 +35,7 @@ public function testIsValid(string $name, bool $isCustom, bool $isValid): void self::assertSame($isValid, $validator->isValid($name, $isCustom)); } - public static function provideIsValidCases(): array + public static function provideIsValidCases(): iterable { return [ ['', true, false], diff --git a/tests/Linter/AbstractLinterTestCase.php b/tests/Linter/AbstractLinterTestCase.php index 549615bb875..680f4b15578 100644 --- a/tests/Linter/AbstractLinterTestCase.php +++ b/tests/Linter/AbstractLinterTestCase.php @@ -59,7 +59,7 @@ public function testLintFile(string $file, ?string $errorMessage = null): void /** * @medium */ - public static function provideLintFileCases(): array + public static function provideLintFileCases(): iterable { return [ [ @@ -92,7 +92,7 @@ public function testLintSource(string $source, ?string $errorMessage = null): vo $linter->lintSource($source)->check(); } - public static function provideLintSourceCases(): array + public static function provideLintSourceCases(): iterable { return [ [ diff --git a/tests/Linter/CachingLinterTest.php b/tests/Linter/CachingLinterTest.php index 46cb0594388..206644a4af2 100644 --- a/tests/Linter/CachingLinterTest.php +++ b/tests/Linter/CachingLinterTest.php @@ -40,7 +40,7 @@ public function testIsAsync(bool $isAsync): void self::assertSame($isAsync, $linter->isAsync()); } - public static function provideIsAsyncCases(): array + public static function provideIsAsyncCases(): iterable { return [ [true], diff --git a/tests/PregTest.php b/tests/PregTest.php index 9fb769ec37d..6253e6711da 100644 --- a/tests/PregTest.php +++ b/tests/PregTest.php @@ -212,7 +212,7 @@ public function testReplaceCallback($pattern, $subject): void self::assertSame($expectedResult, $actualResult); } - public static function provideCommonCases(): array + public static function provideCommonCases(): iterable { return [ ['/u/u', 'u'], diff --git a/tests/RuleSet/RuleSetsTest.php b/tests/RuleSet/RuleSetsTest.php index 892b02346a7..715fe4a6807 100644 --- a/tests/RuleSet/RuleSetsTest.php +++ b/tests/RuleSet/RuleSetsTest.php @@ -140,7 +140,7 @@ public function testSetDefinitionsItselfIsSorted(): void self::assertSame($sortedSetDefinition, $setDefinition); } - public static function provideSetDefinitionNameCases(): array + public static function provideSetDefinitionNameCases(): iterable { $setDefinitionNames = RuleSets::getSetDefinitionNames(); @@ -166,7 +166,7 @@ public function testPHPUnitMigrationTargetVersions(string $setName): void /** * @return string[][] */ - public static function providePHPUnitMigrationTargetVersionsCases(): array + public static function providePHPUnitMigrationTargetVersionsCases(): iterable { $setDefinitionNames = RuleSets::getSetDefinitionNames(); diff --git a/tests/Smoke/CiIntegrationTest.php b/tests/Smoke/CiIntegrationTest.php index 102b1739ac4..5fac77971ef 100644 --- a/tests/Smoke/CiIntegrationTest.php +++ b/tests/Smoke/CiIntegrationTest.php @@ -199,7 +199,7 @@ public function testIntegration( ); } - public static function provideIntegrationCases(): array + public static function provideIntegrationCases(): iterable { return [ 'random-changes' => [ diff --git a/tests/Test/AbstractIntegrationTestCase.php b/tests/Test/AbstractIntegrationTestCase.php index 112f5ac30b2..48e4f8443de 100644 --- a/tests/Test/AbstractIntegrationTestCase.php +++ b/tests/Test/AbstractIntegrationTestCase.php @@ -138,7 +138,7 @@ public function testIntegration(IntegrationCase $case): void * * @return IntegrationCase[][] */ - public static function provideIntegrationCases(): array + public static function provideIntegrationCases(): iterable { $dir = static::getFixturesDir(); $fixturesDir = realpath($dir); diff --git a/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php b/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php index a15af9be568..dd6d915e27f 100644 --- a/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php +++ b/tests/Tokenizer/Analyzer/Analysis/TypeAnalysisTest.php @@ -58,7 +58,7 @@ public function testReserved(string $type, bool $expected): void self::assertSame($expected, $analysis->isReservedType()); } - public static function provideReservedCases(): array + public static function provideReservedCases(): iterable { return [ ['array', true], diff --git a/tests/Tokenizer/Analyzer/BlocksAnalyzerTest.php b/tests/Tokenizer/Analyzer/BlocksAnalyzerTest.php index 0789782023f..0662393f05a 100644 --- a/tests/Tokenizer/Analyzer/BlocksAnalyzerTest.php +++ b/tests/Tokenizer/Analyzer/BlocksAnalyzerTest.php @@ -38,7 +38,7 @@ public function testBlocks(string $code, int $openIndex, int $closeIndex): void self::assertTrue($analyzer->isBlock($tokens, $openIndex, $closeIndex)); } - public static function provideBlocksCases(): array + public static function provideBlocksCases(): iterable { return [ ['isBlock($tokens, $openIndex, $closeIndex)); } - public static function provideNonBlocksCases(): array + public static function provideNonBlocksCases(): iterable { return [ ['isHeaderComment($tokens, $index)); } - public static function provideCommentsCases(): array + public static function provideCommentsCases(): iterable { return [ 'discover all 4 comments for the 1st comment with slash' => [ @@ -168,7 +168,7 @@ public function testHeaderComment(string $code, int $index): void self::assertTrue($analyzer->isHeaderComment($tokens, $index)); } - public static function provideHeaderCommentCases(): array + public static function provideHeaderCommentCases(): iterable { return [ ['isHeaderComment($tokens, $index)); } - public static function provideNotHeaderCommentCases(): array + public static function provideNotHeaderCommentCases(): iterable { return [ ['isBeforeStructuralElement($tokens, $index)); } - public static function providePhpdocCandidateCases(): array + public static function providePhpdocCandidateCases(): iterable { return [ ['isBeforeStructuralElement($tokens, $index)); } - public static function provideNotPhpdocCandidateCases(): array + public static function provideNotPhpdocCandidateCases(): iterable { return [ ['isCast()); } - public static function provideIsCastCases(): array + public static function provideIsCastCases(): iterable { return [ [self::getBraceToken(), false], @@ -98,7 +98,7 @@ public function testIsClassy(Token $token, bool $isClassy): void self::assertSame($isClassy, $token->isClassy()); } - public static function provideIsClassyCases(): array + public static function provideIsClassyCases(): iterable { return [ [self::getBraceToken(), false], @@ -235,7 +235,7 @@ public function testIsNativeConstant(Token $token, bool $isNativeConstant): void self::assertSame($isNativeConstant, $token->isNativeConstant()); } - public static function provideIsNativeConstantCases(): array + public static function provideIsNativeConstantCases(): iterable { return [ [self::getBraceToken(), false], @@ -261,7 +261,7 @@ public function testIsWhitespace(Token $token, bool $isWhitespace, ?string $whit } } - public static function provideIsWhitespaceCases(): array + public static function provideIsWhitespaceCases(): iterable { return [ [self::getBraceToken(), false], @@ -294,7 +294,7 @@ public function testCreatingToken($prototype, ?int $expectedId, ?string $expecte self::assertSame($expectedIsArray, $token->isArray()); } - public static function provideCreatingTokenCases(): array + public static function provideCreatingTokenCases(): iterable { return [ [[T_FOREACH, 'foreach'], T_FOREACH, 'foreach', true], @@ -478,7 +478,7 @@ public function testTokenGetNameForId(?string $expected, int $id): void self::assertSame($expected, Token::getNameForId($id)); } - public static function provideTokenGetNameForIdCases(): array + public static function provideTokenGetNameForIdCases(): iterable { return [ [ diff --git a/tests/Tokenizer/TokensAnalyzerTest.php b/tests/Tokenizer/TokensAnalyzerTest.php index 6edb17b437b..4682765199e 100644 --- a/tests/Tokenizer/TokensAnalyzerTest.php +++ b/tests/Tokenizer/TokensAnalyzerTest.php @@ -813,7 +813,7 @@ public function testIsLambda(array $expected, string $source): void } } - public static function provideIsLambdaCases(): array + public static function provideIsLambdaCases(): iterable { return [ [ @@ -942,7 +942,7 @@ public function testIsLambda80(array $expected, string $source): void } } - public static function provideIsLambda80Cases(): array + public static function provideIsLambda80Cases(): iterable { return [ [ @@ -997,7 +997,7 @@ public function testIsConstantInvocation(array $expected, string $source): void $this->doIsConstantInvocationTest($expected, $source); } - public static function provideIsConstantInvocationCases(): array + public static function provideIsConstantInvocationCases(): iterable { return [ [ @@ -1409,7 +1409,7 @@ public function testIsUnarySuccessorOperator(array $expected, string $source): v } } - public static function provideIsUnarySuccessorOperatorCases(): array + public static function provideIsUnarySuccessorOperatorCases(): iterable { return [ [ @@ -1470,7 +1470,7 @@ public function testIsUnaryPredecessorOperator(array $expected, string $source): } } - public static function provideIsUnaryPredecessorOperatorCases(): array + public static function provideIsUnaryPredecessorOperatorCases(): iterable { return [ [ @@ -1722,7 +1722,7 @@ public function testIsArray(string $source, int $tokenIndex, bool $isMultiLineAr self::assertSame($isMultiLineArray, $tokensAnalyzer->isArrayMultiLine($tokenIndex), sprintf('Expected %sto be a multiline array', $isMultiLineArray ? '' : 'not ')); } - public static function provideIsArrayCases(): array + public static function provideIsArrayCases(): iterable { return [ [ @@ -1805,7 +1805,7 @@ public function testIsArray71(string $source, array $tokenIndexes): void } } - public static function provideIsArray71Cases(): array + public static function provideIsArray71Cases(): iterable { return [ [ @@ -2001,7 +2001,7 @@ public function testIsMultiLineArrayException(string $source, int $tokenIndex): $tokensAnalyzer->isArrayMultiLine($tokenIndex); } - public static function provideArrayExceptionsCases(): array + public static function provideArrayExceptionsCases(): iterable { return [ [' null, @@ -2226,7 +2226,7 @@ public function testGetImportUseIndexes(array $expected, string $input, bool $pe self::assertSame($expected, $tokensAnalyzer->getImportUseIndexes($perNamespace)); } - public static function provideGetImportUseIndexesCases(): array + public static function provideGetImportUseIndexesCases(): iterable { return [ [ @@ -2410,7 +2410,7 @@ public function testIsSuperGlobal(bool $expected, string $source, int $index): v self::assertSame($expected, $tokensAnalyzer->isSuperGlobal($index)); } - public static function provideIsSuperGlobalCases(): array + public static function provideIsSuperGlobalCases(): iterable { $superNames = [ '$_COOKIE', diff --git a/tests/Tokenizer/TokensTest.php b/tests/Tokenizer/TokensTest.php index 828f585c282..2f851cc485c 100644 --- a/tests/Tokenizer/TokensTest.php +++ b/tests/Tokenizer/TokensTest.php @@ -76,7 +76,7 @@ public function testFindSequence( ); } - public static function provideFindSequenceCases(): array + public static function provideFindSequenceCases(): iterable { return [ [ @@ -294,7 +294,7 @@ public function testFindSequenceException(string $message, array $sequence): voi $tokens->findSequence($sequence); } - public static function provideFindSequenceExceptionCases(): array + public static function provideFindSequenceExceptionCases(): iterable { $emptyToken = new Token(''); @@ -534,7 +534,7 @@ public function testClearTokenAndMergeSurroundingWhitespace(string $source, arra } } - public static function provideClearTokenAndMergeSurroundingWhitespaceCases(): array + public static function provideClearTokenAndMergeSurroundingWhitespaceCases(): iterable { $clearToken = new Token(''); @@ -657,7 +657,7 @@ public function testTokenOfKindSibling( self::assertSame($expectedIndex, $tokens->getTokenOfKindSibling($index, $direction, $findTokens, $caseSensitive)); } - public static function provideTokenOfKindSiblingCases(): array + public static function provideTokenOfKindSiblingCases(): iterable { return [ // find next cases @@ -696,7 +696,7 @@ public function testFindBlockEnd(int $expectedIndex, string $source, int $type, self::assertFindBlockEnd($expectedIndex, $source, $type, $searchIndex); } - public static function provideFindBlockEndCases(): array + public static function provideFindBlockEndCases(): iterable { return [ [4, 'isEmptyAt(0), $token->toJson()); } - public static function provideIsEmptyCases(): array + public static function provideIsEmptyCases(): iterable { return [ [new Token(''), true], @@ -952,7 +952,7 @@ public function testEnsureWhitespaceAtIndex(string $expected, string $input, int self::assertTokens(Tokens::fromCode($expected), $tokens); } - public static function provideEnsureWhitespaceAtIndexCases(): array + public static function provideEnsureWhitespaceAtIndexCases(): iterable { return [ [ @@ -1116,7 +1116,7 @@ public function testRemoveLeadingWhitespace(int $index, ?string $whitespaces, st self::assertSame($expected, $tokens->generateCode()); } - public static function provideRemoveLeadingWhitespaceCases(): array + public static function provideRemoveLeadingWhitespaceCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/ArrayTypehintTransformerTest.php b/tests/Tokenizer/Transformer/ArrayTypehintTransformerTest.php index f31d674e5a8..960caa17aff 100644 --- a/tests/Tokenizer/Transformer/ArrayTypehintTransformerTest.php +++ b/tests/Tokenizer/Transformer/ArrayTypehintTransformerTest.php @@ -43,7 +43,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/BraceClassInstantiationTransformerTest.php b/tests/Tokenizer/Transformer/BraceClassInstantiationTransformerTest.php index 7338bf49da2..87dde72b3db 100644 --- a/tests/Tokenizer/Transformer/BraceClassInstantiationTransformerTest.php +++ b/tests/Tokenizer/Transformer/BraceClassInstantiationTransformerTest.php @@ -41,7 +41,7 @@ public function testProcess(string $source, array $expectedTokens, array $observ ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/ClassConstantTransformerTest.php b/tests/Tokenizer/Transformer/ClassConstantTransformerTest.php index 9fffc3c984f..7bbe852148b 100644 --- a/tests/Tokenizer/Transformer/ClassConstantTransformerTest.php +++ b/tests/Tokenizer/Transformer/ClassConstantTransformerTest.php @@ -42,7 +42,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/CurlyBraceTransformerTest.php b/tests/Tokenizer/Transformer/CurlyBraceTransformerTest.php index 7c72cebeb9f..24f7e75a51f 100644 --- a/tests/Tokenizer/Transformer/CurlyBraceTransformerTest.php +++ b/tests/Tokenizer/Transformer/CurlyBraceTransformerTest.php @@ -54,7 +54,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ 'curly open/close I' => [ @@ -235,7 +235,7 @@ public function testProcess80(string $source, array $expectedTokens = []): void ); } - public static function provideProcess80Cases(): array + public static function provideProcess80Cases(): iterable { return [ 'dynamic nullable property brace open/close' => [ diff --git a/tests/Tokenizer/Transformer/ImportTransformerTest.php b/tests/Tokenizer/Transformer/ImportTransformerTest.php index 91a32bed87c..764a31afd00 100644 --- a/tests/Tokenizer/Transformer/ImportTransformerTest.php +++ b/tests/Tokenizer/Transformer/ImportTransformerTest.php @@ -45,7 +45,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/NamespaceOperatorTransformerTest.php b/tests/Tokenizer/Transformer/NamespaceOperatorTransformerTest.php index 81f96b74456..fac81ac174c 100644 --- a/tests/Tokenizer/Transformer/NamespaceOperatorTransformerTest.php +++ b/tests/Tokenizer/Transformer/NamespaceOperatorTransformerTest.php @@ -43,7 +43,7 @@ public function testProcess(string $source, array $expectedTokens): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/NullableTypeTransformerTest.php b/tests/Tokenizer/Transformer/NullableTypeTransformerTest.php index 3bceadd60bf..3931a2bd453 100644 --- a/tests/Tokenizer/Transformer/NullableTypeTransformerTest.php +++ b/tests/Tokenizer/Transformer/NullableTypeTransformerTest.php @@ -42,7 +42,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/ReturnRefTransformerTest.php b/tests/Tokenizer/Transformer/ReturnRefTransformerTest.php index 5d78dc7c05a..81b289143df 100644 --- a/tests/Tokenizer/Transformer/ReturnRefTransformerTest.php +++ b/tests/Tokenizer/Transformer/ReturnRefTransformerTest.php @@ -42,7 +42,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/SquareBraceTransformerTest.php b/tests/Tokenizer/Transformer/SquareBraceTransformerTest.php index 5dcf49c931b..6cb52192307 100644 --- a/tests/Tokenizer/Transformer/SquareBraceTransformerTest.php +++ b/tests/Tokenizer/Transformer/SquareBraceTransformerTest.php @@ -63,7 +63,7 @@ public function testIsShortArray(string $source, array $inspectIndexes, bool $ex } } - public static function provideIsShortArrayCases(): array + public static function provideIsShortArrayCases(): iterable { return [ [' [ @@ -379,7 +379,7 @@ public function testProcess72(string $source, array $expectedTokens): void ); } - public static function provideProcess72Cases(): array + public static function provideProcess72Cases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/TypeColonTransformerTest.php b/tests/Tokenizer/Transformer/TypeColonTransformerTest.php index ca35d3cb67b..1bb53746b19 100644 --- a/tests/Tokenizer/Transformer/TypeColonTransformerTest.php +++ b/tests/Tokenizer/Transformer/TypeColonTransformerTest.php @@ -42,7 +42,7 @@ public function testProcess(string $source, array $expectedTokens = []): void ); } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ @@ -121,7 +121,7 @@ public function testProcess81(string $source, array $expectedTokens = []): void ); } - public static function provideProcess81Cases(): array + public static function provideProcess81Cases(): iterable { return [ [ diff --git a/tests/Tokenizer/Transformer/WhitespacyCommentTransformerTest.php b/tests/Tokenizer/Transformer/WhitespacyCommentTransformerTest.php index bce569f0c5a..82e90fae36e 100644 --- a/tests/Tokenizer/Transformer/WhitespacyCommentTransformerTest.php +++ b/tests/Tokenizer/Transformer/WhitespacyCommentTransformerTest.php @@ -43,7 +43,7 @@ public function testProcess(string $source, array $expectedTokens): void } } - public static function provideProcessCases(): array + public static function provideProcessCases(): iterable { return [ [ diff --git a/tests/Tokenizer/TransformersTest.php b/tests/Tokenizer/TransformersTest.php index acffadc029f..475e6a89f88 100644 --- a/tests/Tokenizer/TransformersTest.php +++ b/tests/Tokenizer/TransformersTest.php @@ -42,7 +42,7 @@ public function testTransform(string $input, array $expectedTokenKinds): void } } - public static function provideTransformCases(): array + public static function provideTransformCases(): iterable { return [ 'use trait after complex string variable' => [ diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index a35c5952632..c0e46a409eb 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -61,7 +61,7 @@ public function testCamelCaseToUnderscore(string $expected, string $input = null self::assertSame($expected, Utils::camelCaseToUnderscore($expected)); } - public static function provideCamelCaseToUnderscoreCases(): array + public static function provideCamelCaseToUnderscoreCases(): iterable { return [ [ @@ -126,7 +126,7 @@ public function testCalculateTrailingWhitespaceIndent(string $spaces, $input): v self::assertSame($spaces, Utils::calculateTrailingWhitespaceIndent($token)); } - public static function provideCalculateTrailingWhitespaceIndentCases(): array + public static function provideCalculateTrailingWhitespaceIndentCases(): iterable { return [ [' ', [T_WHITESPACE, "\n\n "]], @@ -166,7 +166,7 @@ public function testStableSort( ); } - public static function provideStableSortCases(): array + public static function provideStableSortCases(): iterable { return [ [ @@ -325,7 +325,7 @@ public function testNaturalLanguageJoinWithBackticks(string $joined, array $name self::assertSame($joined, Utils::naturalLanguageJoinWithBackticks($names)); } - public static function provideNaturalLanguageJoinWithBackticksCases(): array + public static function provideNaturalLanguageJoinWithBackticksCases(): iterable { return [ [ diff --git a/tests/WhitespacesFixerConfigTest.php b/tests/WhitespacesFixerConfigTest.php index dfa1563b945..d88e722e0e3 100644 --- a/tests/WhitespacesFixerConfigTest.php +++ b/tests/WhitespacesFixerConfigTest.php @@ -41,7 +41,7 @@ public function testFix(string $indent, string $lineEnding, ?string $exceptionRe self::assertSame($lineEnding, $config->getLineEnding()); } - public static function provideFixCases(): array + public static function provideFixCases(): iterable { return [ [' ', "\n"], diff --git a/tests/WordMatcherTest.php b/tests/WordMatcherTest.php index 64cd3a5be4c..1f8aef1dd09 100644 --- a/tests/WordMatcherTest.php +++ b/tests/WordMatcherTest.php @@ -36,7 +36,7 @@ public function testMatch(?string $expected, string $needle, array $candidates): self::assertSame($expected, $matcher->match($needle)); } - public static function provideMatchCases(): array + public static function provideMatchCases(): iterable { return [ [