From b49682a4853803f72996fbd6664b5e69a75472ae Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Thu, 13 Jan 2022 14:38:17 -0500 Subject: [PATCH] Simplify issue suppression in tests --- tests/AnnotationTest.php | 21 +++++++------------ tests/ArgTest.php | 4 ++-- tests/ArrayAccessTest.php | 4 ++-- tests/ArrayAssignmentTest.php | 4 ++-- tests/ArrayFunctionCallTest.php | 4 ++-- tests/AssertAnnotationTest.php | 4 ++-- tests/AssignmentTest.php | 4 ++-- tests/AttributeTest.php | 4 ++-- tests/BinaryOperationTest.php | 4 ++-- tests/CallableTest.php | 4 ++-- tests/ClassLikeStringTest.php | 4 ++-- tests/ClassLoadOrderTest.php | 4 ++-- tests/ClassScopeTest.php | 4 ++-- tests/ClassTest.php | 4 ++-- tests/CloneTest.php | 4 ++-- tests/ClosureTest.php | 4 ++-- tests/ConstValuesTest.php | 4 ++-- tests/ConstantTest.php | 4 ++-- tests/CoreStubsTest.php | 2 +- tests/DeprecatedAnnotationTest.php | 4 ++-- tests/DocblockInheritanceTest.php | 4 ++-- tests/EnumTest.php | 4 ++-- tests/ExtendsFinalClassTest.php | 4 ++-- tests/ForbiddenCodeTest.php | 4 ++-- tests/FunctionCallTest.php | 4 ++-- tests/GeneratorTest.php | 4 ++-- tests/IfThisIsTest.php | 2 +- tests/ImmutableAnnotationTest.php | 4 ++-- tests/IntRangeTest.php | 4 ++-- tests/InterfaceTest.php | 4 ++-- tests/InternalAnnotationTest.php | 4 ++-- tests/IssueSuppressionTest.php | 4 ++-- tests/ListTest.php | 4 ++-- tests/Loop/DoTest.php | 4 ++-- tests/Loop/ForTest.php | 4 ++-- tests/Loop/ForeachTest.php | 4 ++-- tests/Loop/WhileTest.php | 4 ++-- tests/MagicMethodAnnotationTest.php | 4 ++-- tests/MagicPropertyTest.php | 4 ++-- tests/MatchTest.php | 4 ++-- tests/MethodCallTest.php | 4 ++-- tests/MethodSignatureTest.php | 4 ++-- tests/MixinAnnotationTest.php | 4 ++-- tests/NamespaceTest.php | 4 ++-- tests/Php40Test.php | 2 +- tests/Php55Test.php | 2 +- tests/Php56Test.php | 2 +- tests/Php70Test.php | 4 ++-- tests/Php71Test.php | 4 ++-- tests/PropertyTypeInvarianceTest.php | 4 ++-- tests/PropertyTypeTest.php | 9 +++----- tests/PureAnnotationTest.php | 4 ++-- tests/PureCallableTest.php | 4 ++-- tests/ReadonlyPropertyTest.php | 4 ++-- tests/ReferenceConstraintTest.php | 4 ++-- tests/ReturnTypeTest.php | 4 ++-- tests/SuperGlobalsTest.php | 2 +- tests/SwitchTypeTest.php | 4 ++-- tests/Template/ClassStringMapTest.php | 4 ++-- .../Template/ClassTemplateCovarianceTest.php | 4 ++-- tests/Template/ClassTemplateExtendsTest.php | 4 ++-- tests/Template/ClassTemplateTest.php | 4 ++-- tests/Template/ConditionalReturnTypeTest.php | 2 +- .../FunctionClassStringTemplateTest.php | 4 ++-- tests/Template/FunctionTemplateAssertTest.php | 4 ++-- tests/Template/FunctionTemplateTest.php | 4 ++-- tests/Template/NestedTemplateTest.php | 4 ++-- tests/Template/TraitTemplateTest.php | 4 ++-- tests/ThisOutTest.php | 2 +- tests/ToStringTest.php | 4 ++-- tests/TraceTest.php | 2 +- tests/TraitTest.php | 4 ++-- tests/Traits/InvalidCodeAnalysisTestTrait.php | 15 +++++-------- tests/Traits/ValidCodeAnalysisTestTrait.php | 15 +++++-------- tests/TryCatchTest.php | 4 ++-- tests/TypeAnnotationTest.php | 4 ++-- tests/TypeCombinationTest.php | 2 +- .../TypeReconciliation/ArrayKeyExistsTest.php | 4 ++-- .../AssignmentInConditionalTest.php | 4 ++-- tests/TypeReconciliation/ConditionalTest.php | 4 ++-- tests/TypeReconciliation/EmptyTest.php | 4 ++-- tests/TypeReconciliation/InArrayTest.php | 4 ++-- tests/TypeReconciliation/IssetTest.php | 4 ++-- .../RedundantConditionTest.php | 4 ++-- tests/TypeReconciliation/ScopeTest.php | 4 ++-- tests/TypeReconciliation/TypeAlgebraTest.php | 4 ++-- tests/TypeReconciliation/TypeTest.php | 4 ++-- tests/TypeReconciliation/ValueTest.php | 2 +- tests/UnusedCodeTest.php | 2 +- tests/UnusedVariableTest.php | 2 +- 90 files changed, 180 insertions(+), 198 deletions(-) diff --git a/tests/AnnotationTest.php b/tests/AnnotationTest.php index 66ab747d3..8d287fd77 100644 --- a/tests/AnnotationTest.php +++ b/tests/AnnotationTest.php @@ -147,7 +147,7 @@ class AnnotationTest extends TestCase } /** - * @return iterable,ignored_issues?:array,php_version?:string}> + * @return iterable,ignored_issues?:list,php_version?:string}> */ public function providerValidCodeParse(): iterable { @@ -193,7 +193,7 @@ class AnnotationTest extends TestCase } }', 'assertions' => [], - 'error_level' => ['RedundantConditionGivenDocblockType'], + 'ignored_issues' => ['RedundantConditionGivenDocblockType'], ], 'checkArrayWithIs' => [ 'code' => ' [], - 'error_level' => ['RedundantConditionGivenDocblockType'], + 'ignored_issues' => ['RedundantConditionGivenDocblockType'], ], 'goodDocblock' => [ 'code' => 'getMessage();', 'assertions' => [], - 'error_level' => ['EmptyArrayAccess', 'MixedMethodCall'], + 'ignored_issues' => ['EmptyArrayAccess', 'MixedMethodCall'], ], 'psalmIgnoreVarDocblock' => [ 'code' => 'getMessage();', 'assertions' => [], - 'error_level' => ['EmptyArrayAccess', 'MixedMethodCall'], + 'ignored_issues' => ['EmptyArrayAccess', 'MixedMethodCall'], ], 'mixedDocblockParamTypeDefinedInParent' => [ 'code' => ' [], - 'ignored_issues' => [ - 'InvalidDocblock' => Config::REPORT_INFO, - 'MissingReturnType' => Config::REPORT_INFO, - ], + 'ignored_issues' => ['InvalidDocblock', 'MissingReturnType'], ], 'objectWithPropertiesAnnotation' => [ 'code' => '}> + * @return iterable}> */ public function providerInvalidCodeParse(): iterable { @@ -1368,9 +1365,7 @@ class AnnotationTest extends TestCase function fooBar() { }', 'error_message' => 'MissingReturnType', - 'ignored_issues' => [ - 'InvalidDocblock' => Config::REPORT_INFO, - ], + 'ignored_issues' => ['InvalidDocblock'], ], 'invalidDocblockReturn' => [ 'code' => ',ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -313,7 +313,7 @@ class ArgTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ArrayAccessTest.php b/tests/ArrayAccessTest.php index 9796244be..643915e05 100644 --- a/tests/ArrayAccessTest.php +++ b/tests/ArrayAccessTest.php @@ -362,7 +362,7 @@ class ArrayAccessTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1042,7 +1042,7 @@ class ArrayAccessTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ArrayAssignmentTest.php b/tests/ArrayAssignmentTest.php index 35872392f..ec0c6831b 100644 --- a/tests/ArrayAssignmentTest.php +++ b/tests/ArrayAssignmentTest.php @@ -32,7 +32,7 @@ class ArrayAssignmentTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1739,7 +1739,7 @@ class ArrayAssignmentTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ArrayFunctionCallTest.php b/tests/ArrayFunctionCallTest.php index 92d57355c..73eb86f1f 100644 --- a/tests/ArrayFunctionCallTest.php +++ b/tests/ArrayFunctionCallTest.php @@ -13,7 +13,7 @@ class ArrayFunctionCallTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -2125,7 +2125,7 @@ class ArrayFunctionCallTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/AssertAnnotationTest.php b/tests/AssertAnnotationTest.php index 6e3b50e8c..fcad01f90 100644 --- a/tests/AssertAnnotationTest.php +++ b/tests/AssertAnnotationTest.php @@ -92,7 +92,7 @@ class AssertAnnotationTest extends TestCase /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1975,7 +1975,7 @@ class AssertAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/AssignmentTest.php b/tests/AssignmentTest.php index 50cb743ef..29749fcbf 100644 --- a/tests/AssignmentTest.php +++ b/tests/AssignmentTest.php @@ -11,7 +11,7 @@ class AssignmentTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -98,7 +98,7 @@ class AssignmentTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/AttributeTest.php b/tests/AttributeTest.php index 8270401b3..d9067b676 100644 --- a/tests/AttributeTest.php +++ b/tests/AttributeTest.php @@ -11,7 +11,7 @@ class AttributeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -245,7 +245,7 @@ class AttributeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/BinaryOperationTest.php b/tests/BinaryOperationTest.php index 655a45eee..63af0a13a 100644 --- a/tests/BinaryOperationTest.php +++ b/tests/BinaryOperationTest.php @@ -260,7 +260,7 @@ class BinaryOperationTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -848,7 +848,7 @@ class BinaryOperationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/CallableTest.php b/tests/CallableTest.php index 24987f8d7..72a0ca9e5 100644 --- a/tests/CallableTest.php +++ b/tests/CallableTest.php @@ -11,7 +11,7 @@ class CallableTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1050,7 +1050,7 @@ class CallableTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ClassLikeStringTest.php b/tests/ClassLikeStringTest.php index 2b5a3e7ef..1be529422 100644 --- a/tests/ClassLikeStringTest.php +++ b/tests/ClassLikeStringTest.php @@ -54,7 +54,7 @@ class ClassLikeStringTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -815,7 +815,7 @@ class ClassLikeStringTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ClassLoadOrderTest.php b/tests/ClassLoadOrderTest.php index cd815b1c1..4dc07fa14 100644 --- a/tests/ClassLoadOrderTest.php +++ b/tests/ClassLoadOrderTest.php @@ -11,7 +11,7 @@ class ClassLoadOrderTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -123,7 +123,7 @@ class ClassLoadOrderTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ClassScopeTest.php b/tests/ClassScopeTest.php index 9ebf98ac8..1047a5b53 100644 --- a/tests/ClassScopeTest.php +++ b/tests/ClassScopeTest.php @@ -11,7 +11,7 @@ class ClassScopeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -154,7 +154,7 @@ class ClassScopeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ClassTest.php b/tests/ClassTest.php index 72dbae7ef..332f998c8 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -46,7 +46,7 @@ class ClassTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -652,7 +652,7 @@ class ClassTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/CloneTest.php b/tests/CloneTest.php index 1590e62b8..de2fa5bda 100644 --- a/tests/CloneTest.php +++ b/tests/CloneTest.php @@ -13,7 +13,7 @@ class CloneTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -49,7 +49,7 @@ class CloneTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ClosureTest.php b/tests/ClosureTest.php index b7d466699..841dd0740 100644 --- a/tests/ClosureTest.php +++ b/tests/ClosureTest.php @@ -13,7 +13,7 @@ class ClosureTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -739,7 +739,7 @@ class ClosureTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ConstValuesTest.php b/tests/ConstValuesTest.php index 8a81b648c..4358c0367 100644 --- a/tests/ConstValuesTest.php +++ b/tests/ConstValuesTest.php @@ -11,7 +11,7 @@ class ConstValuesTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -109,7 +109,7 @@ class ConstValuesTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ConstantTest.php b/tests/ConstantTest.php index 74177bc55..3b6351782 100644 --- a/tests/ConstantTest.php +++ b/tests/ConstantTest.php @@ -11,7 +11,7 @@ class ConstantTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array, php_version?: string}> + * @return iterable,ignored_issues?:list, php_version?: string}> */ public function providerValidCodeParse(): iterable { @@ -1234,7 +1234,7 @@ class ConstantTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/CoreStubsTest.php b/tests/CoreStubsTest.php index a68c53a23..946e1e1d1 100644 --- a/tests/CoreStubsTest.php +++ b/tests/CoreStubsTest.php @@ -9,7 +9,7 @@ class CoreStubsTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/DeprecatedAnnotationTest.php b/tests/DeprecatedAnnotationTest.php index 5c92c78bf..edcdf81c5 100644 --- a/tests/DeprecatedAnnotationTest.php +++ b/tests/DeprecatedAnnotationTest.php @@ -11,7 +11,7 @@ class DeprecatedAnnotationTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -96,7 +96,7 @@ class DeprecatedAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/DocblockInheritanceTest.php b/tests/DocblockInheritanceTest.php index e8e05100f..6a1762a31 100644 --- a/tests/DocblockInheritanceTest.php +++ b/tests/DocblockInheritanceTest.php @@ -11,7 +11,7 @@ class DocblockInheritanceTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -154,7 +154,7 @@ class DocblockInheritanceTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/EnumTest.php b/tests/EnumTest.php index 268477691..66b4b7105 100644 --- a/tests/EnumTest.php +++ b/tests/EnumTest.php @@ -11,7 +11,7 @@ class EnumTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -375,7 +375,7 @@ class EnumTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ExtendsFinalClassTest.php b/tests/ExtendsFinalClassTest.php index 52b7d4cb6..e9adcb8ef 100644 --- a/tests/ExtendsFinalClassTest.php +++ b/tests/ExtendsFinalClassTest.php @@ -11,7 +11,7 @@ class ExtendsFinalClassTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -43,7 +43,7 @@ class ExtendsFinalClassTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ForbiddenCodeTest.php b/tests/ForbiddenCodeTest.php index 2a433376d..ab72309fb 100644 --- a/tests/ForbiddenCodeTest.php +++ b/tests/ForbiddenCodeTest.php @@ -20,7 +20,7 @@ class ForbiddenCodeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { @@ -54,7 +54,7 @@ class ForbiddenCodeTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index ead6c6e18..3504c82fd 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -15,7 +15,7 @@ class FunctionCallTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1789,7 +1789,7 @@ class FunctionCallTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/GeneratorTest.php b/tests/GeneratorTest.php index d215ee2e1..3528d2e78 100644 --- a/tests/GeneratorTest.php +++ b/tests/GeneratorTest.php @@ -11,7 +11,7 @@ class GeneratorTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -312,7 +312,7 @@ class GeneratorTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/IfThisIsTest.php b/tests/IfThisIsTest.php index 9095f80b7..fda3fe273 100644 --- a/tests/IfThisIsTest.php +++ b/tests/IfThisIsTest.php @@ -11,7 +11,7 @@ class IfThisIsTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/ImmutableAnnotationTest.php b/tests/ImmutableAnnotationTest.php index 7383fccd3..6907f517b 100644 --- a/tests/ImmutableAnnotationTest.php +++ b/tests/ImmutableAnnotationTest.php @@ -11,7 +11,7 @@ class ImmutableAnnotationTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -551,7 +551,7 @@ class ImmutableAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/IntRangeTest.php b/tests/IntRangeTest.php index 4a05c0856..3dff88953 100644 --- a/tests/IntRangeTest.php +++ b/tests/IntRangeTest.php @@ -11,7 +11,7 @@ class IntRangeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -691,7 +691,7 @@ class IntRangeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index ce6b07a01..923738610 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -13,7 +13,7 @@ class InterfaceTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -725,7 +725,7 @@ class InterfaceTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/InternalAnnotationTest.php b/tests/InternalAnnotationTest.php index 7898a03d9..ad2b1c57f 100644 --- a/tests/InternalAnnotationTest.php +++ b/tests/InternalAnnotationTest.php @@ -11,7 +11,7 @@ class InternalAnnotationTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -560,7 +560,7 @@ class InternalAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/IssueSuppressionTest.php b/tests/IssueSuppressionTest.php index 83faf85c5..8a08db45a 100644 --- a/tests/IssueSuppressionTest.php +++ b/tests/IssueSuppressionTest.php @@ -251,7 +251,7 @@ class IssueSuppressionTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -410,7 +410,7 @@ class IssueSuppressionTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ListTest.php b/tests/ListTest.php index 50f70ad8f..5840a73ad 100644 --- a/tests/ListTest.php +++ b/tests/ListTest.php @@ -13,7 +13,7 @@ class ListTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -88,7 +88,7 @@ class ListTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Loop/DoTest.php b/tests/Loop/DoTest.php index 23bd9ad71..35fbbc0f7 100644 --- a/tests/Loop/DoTest.php +++ b/tests/Loop/DoTest.php @@ -14,7 +14,7 @@ class DoTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -365,7 +365,7 @@ class DoTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Loop/ForTest.php b/tests/Loop/ForTest.php index a9df0ab46..b8781a116 100644 --- a/tests/Loop/ForTest.php +++ b/tests/Loop/ForTest.php @@ -14,7 +14,7 @@ class ForTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -183,7 +183,7 @@ class ForTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Loop/ForeachTest.php b/tests/Loop/ForeachTest.php index e51dda9f5..cfe854c79 100644 --- a/tests/Loop/ForeachTest.php +++ b/tests/Loop/ForeachTest.php @@ -14,7 +14,7 @@ class ForeachTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1153,7 +1153,7 @@ class ForeachTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Loop/WhileTest.php b/tests/Loop/WhileTest.php index e3975c5e9..d873f8a58 100644 --- a/tests/Loop/WhileTest.php +++ b/tests/Loop/WhileTest.php @@ -12,7 +12,7 @@ class WhileTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -755,7 +755,7 @@ class WhileTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/MagicMethodAnnotationTest.php b/tests/MagicMethodAnnotationTest.php index caad5746a..a99ca0ab5 100644 --- a/tests/MagicMethodAnnotationTest.php +++ b/tests/MagicMethodAnnotationTest.php @@ -147,7 +147,7 @@ class MagicMethodAnnotationTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -754,7 +754,7 @@ class MagicMethodAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/MagicPropertyTest.php b/tests/MagicPropertyTest.php index 8ec112587..11fdcb9cf 100644 --- a/tests/MagicPropertyTest.php +++ b/tests/MagicPropertyTest.php @@ -35,7 +35,7 @@ class MagicPropertyTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -734,7 +734,7 @@ class MagicPropertyTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/MatchTest.php b/tests/MatchTest.php index b6b73bca4..c8ecde0cc 100644 --- a/tests/MatchTest.php +++ b/tests/MatchTest.php @@ -11,7 +11,7 @@ class MatchTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -86,7 +86,7 @@ class MatchTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/MethodCallTest.php b/tests/MethodCallTest.php index 0d3d970c0..f5894bc54 100644 --- a/tests/MethodCallTest.php +++ b/tests/MethodCallTest.php @@ -200,7 +200,7 @@ class MethodCallTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1008,7 +1008,7 @@ class MethodCallTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/MethodSignatureTest.php b/tests/MethodSignatureTest.php index 6a0eb89ac..86276aa9e 100644 --- a/tests/MethodSignatureTest.php +++ b/tests/MethodSignatureTest.php @@ -311,7 +311,7 @@ class MethodSignatureTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -941,7 +941,7 @@ class MethodSignatureTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/MixinAnnotationTest.php b/tests/MixinAnnotationTest.php index 1229e71a0..e874a250d 100644 --- a/tests/MixinAnnotationTest.php +++ b/tests/MixinAnnotationTest.php @@ -11,7 +11,7 @@ class MixinAnnotationTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -598,7 +598,7 @@ class MixinAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/NamespaceTest.php b/tests/NamespaceTest.php index 9516f62f2..ffb129fe9 100644 --- a/tests/NamespaceTest.php +++ b/tests/NamespaceTest.php @@ -11,7 +11,7 @@ class NamespaceTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -75,7 +75,7 @@ class NamespaceTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Php40Test.php b/tests/Php40Test.php index 1d7c9c692..dd67e8724 100644 --- a/tests/Php40Test.php +++ b/tests/Php40Test.php @@ -9,7 +9,7 @@ class Php40Test extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/Php55Test.php b/tests/Php55Test.php index 8dfe3f0a9..8ed1c723a 100644 --- a/tests/Php55Test.php +++ b/tests/Php55Test.php @@ -9,7 +9,7 @@ class Php55Test extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/Php56Test.php b/tests/Php56Test.php index 594a209d3..e7ae3022c 100644 --- a/tests/Php56Test.php +++ b/tests/Php56Test.php @@ -9,7 +9,7 @@ class Php56Test extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/Php70Test.php b/tests/Php70Test.php index aeb50a200..9c2a30213 100644 --- a/tests/Php70Test.php +++ b/tests/Php70Test.php @@ -11,7 +11,7 @@ class Php70Test extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -217,7 +217,7 @@ class Php70Test extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Php71Test.php b/tests/Php71Test.php index fbf54a468..572696bf8 100644 --- a/tests/Php71Test.php +++ b/tests/Php71Test.php @@ -11,7 +11,7 @@ class Php71Test extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -273,7 +273,7 @@ class Php71Test extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/PropertyTypeInvarianceTest.php b/tests/PropertyTypeInvarianceTest.php index dff4ae9de..179a0e407 100644 --- a/tests/PropertyTypeInvarianceTest.php +++ b/tests/PropertyTypeInvarianceTest.php @@ -11,7 +11,7 @@ class PropertyTypeInvarianceTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -238,7 +238,7 @@ class PropertyTypeInvarianceTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/PropertyTypeTest.php b/tests/PropertyTypeTest.php index 3a6b2c59d..fed1037ec 100644 --- a/tests/PropertyTypeTest.php +++ b/tests/PropertyTypeTest.php @@ -346,7 +346,7 @@ class PropertyTypeTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -808,6 +808,7 @@ class PropertyTypeTest extends TestCase public function foo(): void; } + /** @psalm-suppress PropertyNotSetInConstructor */ abstract class A implements I { /** @var string */ public $bar; @@ -822,10 +823,6 @@ class PropertyTypeTest extends TestCase $this->bar = "hello"; } }', - 'assertions' => [], - 'ignored_issues' => [ - 'PropertyNotSetInConstructor' => Config::REPORT_INFO, - ], ], 'callsPrivateParentMethodThenUsesParentInitializedProperty' => [ 'code' => ',php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/PureAnnotationTest.php b/tests/PureAnnotationTest.php index bab5aa7dd..bdf6a90d0 100644 --- a/tests/PureAnnotationTest.php +++ b/tests/PureAnnotationTest.php @@ -11,7 +11,7 @@ class PureAnnotationTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -467,7 +467,7 @@ class PureAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/PureCallableTest.php b/tests/PureCallableTest.php index 9aeabb872..bb9e551d1 100644 --- a/tests/PureCallableTest.php +++ b/tests/PureCallableTest.php @@ -11,7 +11,7 @@ class PureCallableTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -238,7 +238,7 @@ class PureCallableTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ReadonlyPropertyTest.php b/tests/ReadonlyPropertyTest.php index 9e84c59ef..906d488fc 100644 --- a/tests/ReadonlyPropertyTest.php +++ b/tests/ReadonlyPropertyTest.php @@ -13,7 +13,7 @@ class ReadonlyPropertyTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -100,7 +100,7 @@ class ReadonlyPropertyTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ReferenceConstraintTest.php b/tests/ReferenceConstraintTest.php index 1f4d6d435..a7c2952f6 100644 --- a/tests/ReferenceConstraintTest.php +++ b/tests/ReferenceConstraintTest.php @@ -11,7 +11,7 @@ class ReferenceConstraintTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -187,7 +187,7 @@ class ReferenceConstraintTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ReturnTypeTest.php b/tests/ReturnTypeTest.php index d997624d2..b5c6058ae 100644 --- a/tests/ReturnTypeTest.php +++ b/tests/ReturnTypeTest.php @@ -13,7 +13,7 @@ class ReturnTypeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1092,7 +1092,7 @@ class ReturnTypeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/SuperGlobalsTest.php b/tests/SuperGlobalsTest.php index f0b3c4f02..3e7d54ad5 100644 --- a/tests/SuperGlobalsTest.php +++ b/tests/SuperGlobalsTest.php @@ -9,7 +9,7 @@ class SuperGlobalsTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/SwitchTypeTest.php b/tests/SwitchTypeTest.php index 2c3c487c7..d101015a8 100644 --- a/tests/SwitchTypeTest.php +++ b/tests/SwitchTypeTest.php @@ -13,7 +13,7 @@ class SwitchTypeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1091,7 +1091,7 @@ class SwitchTypeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/ClassStringMapTest.php b/tests/Template/ClassStringMapTest.php index 906bc85e9..0ec5e078a 100644 --- a/tests/Template/ClassStringMapTest.php +++ b/tests/Template/ClassStringMapTest.php @@ -12,7 +12,7 @@ class ClassStringMapTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -90,7 +90,7 @@ class ClassStringMapTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/ClassTemplateCovarianceTest.php b/tests/Template/ClassTemplateCovarianceTest.php index 07d67b7d5..fd28d7314 100644 --- a/tests/Template/ClassTemplateCovarianceTest.php +++ b/tests/Template/ClassTemplateCovarianceTest.php @@ -12,7 +12,7 @@ class ClassTemplateCovarianceTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -535,7 +535,7 @@ class ClassTemplateCovarianceTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/ClassTemplateExtendsTest.php b/tests/Template/ClassTemplateExtendsTest.php index 48aa798b7..b59fd283a 100644 --- a/tests/Template/ClassTemplateExtendsTest.php +++ b/tests/Template/ClassTemplateExtendsTest.php @@ -14,7 +14,7 @@ class ClassTemplateExtendsTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -4550,7 +4550,7 @@ class ClassTemplateExtendsTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/ClassTemplateTest.php b/tests/Template/ClassTemplateTest.php index a831c68be..14d1fa71b 100644 --- a/tests/Template/ClassTemplateTest.php +++ b/tests/Template/ClassTemplateTest.php @@ -14,7 +14,7 @@ class ClassTemplateTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -3584,7 +3584,7 @@ class ClassTemplateTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/ConditionalReturnTypeTest.php b/tests/Template/ConditionalReturnTypeTest.php index 9b9b6a170..b79ade2a7 100644 --- a/tests/Template/ConditionalReturnTypeTest.php +++ b/tests/Template/ConditionalReturnTypeTest.php @@ -10,7 +10,7 @@ class ConditionalReturnTypeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/Template/FunctionClassStringTemplateTest.php b/tests/Template/FunctionClassStringTemplateTest.php index 4a169b07d..55b83ba56 100644 --- a/tests/Template/FunctionClassStringTemplateTest.php +++ b/tests/Template/FunctionClassStringTemplateTest.php @@ -12,7 +12,7 @@ class FunctionClassStringTemplateTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -704,7 +704,7 @@ class FunctionClassStringTemplateTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/FunctionTemplateAssertTest.php b/tests/Template/FunctionTemplateAssertTest.php index 3b5160e5a..d2ad19822 100644 --- a/tests/Template/FunctionTemplateAssertTest.php +++ b/tests/Template/FunctionTemplateAssertTest.php @@ -12,7 +12,7 @@ class FunctionTemplateAssertTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -865,7 +865,7 @@ class FunctionTemplateAssertTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/FunctionTemplateTest.php b/tests/Template/FunctionTemplateTest.php index c008aad83..5c63b22b8 100644 --- a/tests/Template/FunctionTemplateTest.php +++ b/tests/Template/FunctionTemplateTest.php @@ -12,7 +12,7 @@ class FunctionTemplateTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1607,7 +1607,7 @@ class FunctionTemplateTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/NestedTemplateTest.php b/tests/Template/NestedTemplateTest.php index bcb664710..9550f0546 100644 --- a/tests/Template/NestedTemplateTest.php +++ b/tests/Template/NestedTemplateTest.php @@ -12,7 +12,7 @@ class NestedTemplateTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -128,7 +128,7 @@ class NestedTemplateTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Template/TraitTemplateTest.php b/tests/Template/TraitTemplateTest.php index 68e50ae8d..c40efa3fc 100644 --- a/tests/Template/TraitTemplateTest.php +++ b/tests/Template/TraitTemplateTest.php @@ -12,7 +12,7 @@ class TraitTemplateTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -517,7 +517,7 @@ class TraitTemplateTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/ThisOutTest.php b/tests/ThisOutTest.php index a28e904ae..87aecf2d9 100644 --- a/tests/ThisOutTest.php +++ b/tests/ThisOutTest.php @@ -9,7 +9,7 @@ class ThisOutTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/ToStringTest.php b/tests/ToStringTest.php index 856f1ea21..d61c0255a 100644 --- a/tests/ToStringTest.php +++ b/tests/ToStringTest.php @@ -11,7 +11,7 @@ class ToStringTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -211,7 +211,7 @@ class ToStringTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TraceTest.php b/tests/TraceTest.php index 25e17270e..b7aea4ac9 100644 --- a/tests/TraceTest.php +++ b/tests/TraceTest.php @@ -9,7 +9,7 @@ class TraceTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TraitTest.php b/tests/TraitTest.php index 5c24f8d10..78553717b 100644 --- a/tests/TraitTest.php +++ b/tests/TraitTest.php @@ -13,7 +13,7 @@ class TraitTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -994,7 +994,7 @@ class TraitTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/Traits/InvalidCodeAnalysisTestTrait.php b/tests/Traits/InvalidCodeAnalysisTestTrait.php index b59d6f46b..9dd9cbae2 100644 --- a/tests/Traits/InvalidCodeAnalysisTestTrait.php +++ b/tests/Traits/InvalidCodeAnalysisTestTrait.php @@ -6,7 +6,6 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; -use function is_int; use function method_exists; use function preg_quote; use function str_replace; @@ -21,7 +20,7 @@ use const PHP_VERSION; trait InvalidCodeAnalysisTestTrait { /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ abstract public function providerInvalidCodeParse(): iterable; @@ -29,7 +28,7 @@ trait InvalidCodeAnalysisTestTrait * @dataProvider providerInvalidCodeParse * @small * - * @param array $error_levels + * @param list $error_levels */ public function testInvalidCode( string $code, @@ -50,13 +49,9 @@ trait InvalidCodeAnalysisTestTrait $code = str_replace("\n", "\r\n", $code); } - foreach ($error_levels as $error_level_key => $error_level) { - if (is_int($error_level_key)) { - $issue_name = $error_level; - $error_level = Config::REPORT_SUPPRESS; - } else { - $issue_name = $error_level_key; - } + foreach ($error_levels as $error_level) { + $issue_name = $error_level; + $error_level = Config::REPORT_SUPPRESS; Config::getInstance()->setCustomErrorLevel($issue_name, $error_level); } diff --git a/tests/Traits/ValidCodeAnalysisTestTrait.php b/tests/Traits/ValidCodeAnalysisTestTrait.php index 4da8e254d..ea52ae588 100644 --- a/tests/Traits/ValidCodeAnalysisTestTrait.php +++ b/tests/Traits/ValidCodeAnalysisTestTrait.php @@ -5,7 +5,6 @@ namespace Psalm\Tests\Traits; use Psalm\Config; use Psalm\Context; -use function is_int; use function str_replace; use function strlen; use function strpos; @@ -19,7 +18,7 @@ use const PHP_VERSION; trait ValidCodeAnalysisTestTrait { /** - * @return iterable,ignored_issues?:array,php_version?:string}> + * @return iterable,ignored_issues?:list,php_version?:string}> */ abstract public function providerValidCodeParse(): iterable; @@ -28,7 +27,7 @@ trait ValidCodeAnalysisTestTrait * * @param string $code * @param array $assertions - * @param array $error_levels + * @param list $error_levels * * @small */ @@ -47,13 +46,9 @@ trait ValidCodeAnalysisTestTrait $this->markTestSkipped('Skipped due to a bug.'); } - foreach ($error_levels as $error_level_key => $error_level) { - if (is_int($error_level_key)) { - $issue_name = $error_level; - $error_level = Config::REPORT_SUPPRESS; - } else { - $issue_name = $error_level_key; - } + foreach ($error_levels as $error_level) { + $issue_name = $error_level; + $error_level = Config::REPORT_SUPPRESS; Config::getInstance()->setCustomErrorLevel($issue_name, $error_level); } diff --git a/tests/TryCatchTest.php b/tests/TryCatchTest.php index b02e86de1..5ee788042 100644 --- a/tests/TryCatchTest.php +++ b/tests/TryCatchTest.php @@ -12,7 +12,7 @@ class TryCatchTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -496,7 +496,7 @@ class TryCatchTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeAnnotationTest.php b/tests/TypeAnnotationTest.php index 6b611f7bc..ffae930bd 100644 --- a/tests/TypeAnnotationTest.php +++ b/tests/TypeAnnotationTest.php @@ -11,7 +11,7 @@ class TypeAnnotationTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -597,7 +597,7 @@ class TypeAnnotationTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeCombinationTest.php b/tests/TypeCombinationTest.php index 7acc8641d..022cccfe3 100644 --- a/tests/TypeCombinationTest.php +++ b/tests/TypeCombinationTest.php @@ -35,7 +35,7 @@ class TypeCombinationTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/ArrayKeyExistsTest.php b/tests/TypeReconciliation/ArrayKeyExistsTest.php index d4fd29c7d..19b7fc3e0 100644 --- a/tests/TypeReconciliation/ArrayKeyExistsTest.php +++ b/tests/TypeReconciliation/ArrayKeyExistsTest.php @@ -12,7 +12,7 @@ class ArrayKeyExistsTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -382,7 +382,7 @@ class ArrayKeyExistsTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/AssignmentInConditionalTest.php b/tests/TypeReconciliation/AssignmentInConditionalTest.php index b735de223..c25b754f9 100644 --- a/tests/TypeReconciliation/AssignmentInConditionalTest.php +++ b/tests/TypeReconciliation/AssignmentInConditionalTest.php @@ -12,7 +12,7 @@ class AssignmentInConditionalTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -459,7 +459,7 @@ class AssignmentInConditionalTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/ConditionalTest.php b/tests/TypeReconciliation/ConditionalTest.php index 809376aef..a67be8b68 100644 --- a/tests/TypeReconciliation/ConditionalTest.php +++ b/tests/TypeReconciliation/ConditionalTest.php @@ -12,7 +12,7 @@ class ConditionalTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -2843,7 +2843,7 @@ class ConditionalTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/EmptyTest.php b/tests/TypeReconciliation/EmptyTest.php index ea2c398de..fe2d09ef3 100644 --- a/tests/TypeReconciliation/EmptyTest.php +++ b/tests/TypeReconciliation/EmptyTest.php @@ -12,7 +12,7 @@ class EmptyTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -422,7 +422,7 @@ class EmptyTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/InArrayTest.php b/tests/TypeReconciliation/InArrayTest.php index 6e108f24c..905b7f4c1 100644 --- a/tests/TypeReconciliation/InArrayTest.php +++ b/tests/TypeReconciliation/InArrayTest.php @@ -14,7 +14,7 @@ class InArrayTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -232,7 +232,7 @@ class InArrayTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/IssetTest.php b/tests/TypeReconciliation/IssetTest.php index 9c63d24b7..e623b25d6 100644 --- a/tests/TypeReconciliation/IssetTest.php +++ b/tests/TypeReconciliation/IssetTest.php @@ -12,7 +12,7 @@ class IssetTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1015,7 +1015,7 @@ class IssetTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/RedundantConditionTest.php b/tests/TypeReconciliation/RedundantConditionTest.php index 56d03dd67..84649c737 100644 --- a/tests/TypeReconciliation/RedundantConditionTest.php +++ b/tests/TypeReconciliation/RedundantConditionTest.php @@ -14,7 +14,7 @@ class RedundantConditionTest extends TestCase use InvalidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -889,7 +889,7 @@ class RedundantConditionTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/ScopeTest.php b/tests/TypeReconciliation/ScopeTest.php index 302002dfe..6719546b3 100644 --- a/tests/TypeReconciliation/ScopeTest.php +++ b/tests/TypeReconciliation/ScopeTest.php @@ -14,7 +14,7 @@ class ScopeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -215,7 +215,7 @@ class ScopeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/TypeAlgebraTest.php b/tests/TypeReconciliation/TypeAlgebraTest.php index 4bf291ec8..9c524a1e3 100644 --- a/tests/TypeReconciliation/TypeAlgebraTest.php +++ b/tests/TypeReconciliation/TypeAlgebraTest.php @@ -12,7 +12,7 @@ class TypeAlgebraTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1163,7 +1163,7 @@ class TypeAlgebraTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/TypeTest.php b/tests/TypeReconciliation/TypeTest.php index 5c703c46e..f040b43b3 100644 --- a/tests/TypeReconciliation/TypeTest.php +++ b/tests/TypeReconciliation/TypeTest.php @@ -14,7 +14,7 @@ class TypeTest extends TestCase use ValidCodeAnalysisTestTrait; /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { @@ -1135,7 +1135,7 @@ class TypeTest extends TestCase } /** - * @return iterable,php_version?:string}> + * @return iterable,php_version?:string}> */ public function providerInvalidCodeParse(): iterable { diff --git a/tests/TypeReconciliation/ValueTest.php b/tests/TypeReconciliation/ValueTest.php index 8128eadc8..5a4ad3b3d 100644 --- a/tests/TypeReconciliation/ValueTest.php +++ b/tests/TypeReconciliation/ValueTest.php @@ -35,7 +35,7 @@ class ValueTest extends TestCase } /** - * @return iterable,ignored_issues?:array}> + * @return iterable,ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { diff --git a/tests/UnusedCodeTest.php b/tests/UnusedCodeTest.php index 004e9b966..bc0d97cad 100644 --- a/tests/UnusedCodeTest.php +++ b/tests/UnusedCodeTest.php @@ -1211,7 +1211,7 @@ class UnusedCodeTest extends TestCase } /** - * @return array}> + * @return array}> */ public function providerInvalidCodeParse(): array { diff --git a/tests/UnusedVariableTest.php b/tests/UnusedVariableTest.php index d3c2fdec2..8e63e3466 100644 --- a/tests/UnusedVariableTest.php +++ b/tests/UnusedVariableTest.php @@ -99,7 +99,7 @@ class UnusedVariableTest extends TestCase } /** - * @return array}> + * @return array}> */ public function providerValidCodeParse(): array {