From 19a5c01fbb5b90e610454e6b3b32241af410f0b2 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 19 Oct 2023 14:16:41 +0200 Subject: [PATCH] Fix --- tests/AlgebraTest.php | 2 ++ tests/AnnotationTest.php | 2 ++ tests/ArgTest.php | 2 ++ tests/ArrayAccessTest.php | 2 ++ tests/ArrayAssignmentTest.php | 2 ++ tests/ArrayFunctionCallTest.php | 2 ++ tests/AssertAnnotationTest.php | 2 ++ tests/AssignmentTest.php | 2 ++ tests/AsyncTestCase.php | 2 ++ tests/AttributeTest.php | 2 ++ tests/BadFormatTest.php | 2 ++ tests/BinaryOperationTest.php | 2 ++ tests/ByIssueLevelAndTypeReportTest.php | 2 ++ tests/Cache/CacheTest.php | 2 +- tests/CallableTest.php | 2 ++ tests/CastTest.php | 2 ++ tests/CheckTypeTest.php | 2 ++ tests/ClassLikeDocblockParserTest.php | 2 ++ tests/ClassLikeStringTest.php | 2 ++ tests/ClassLoadOrderTest.php | 2 ++ tests/ClassScopeTest.php | 2 ++ tests/ClassTest.php | 2 ++ tests/ClosureTest.php | 2 ++ tests/CodebaseTest.php | 2 ++ tests/CommentAnalyzerTest.php | 2 ++ tests/ComposerLockTest.php | 5 +++-- tests/Config/ConfigFileTest.php | 2 ++ tests/Config/ConfigTest.php | 2 ++ tests/Config/CreatorTest.php | 2 ++ tests/Config/Plugin/AfterAnalysisPlugin.php | 2 ++ tests/Config/Plugin/FilePlugin.php | 2 ++ .../Config/Plugin/FileTypeSelfRegisteringPlugin.php | 2 ++ tests/Config/Plugin/FunctionPlugin.php | 2 ++ tests/Config/Plugin/Hook/AfterAnalysis.php | 2 ++ .../Hook/CustomArrayMapFunctionStorageProvider.php | 8 +++++--- tests/Config/Plugin/Hook/FileProvider.php | 2 ++ tests/Config/Plugin/Hook/FooMethodProvider.php | 2 ++ tests/Config/Plugin/Hook/FooPropertyProvider.php | 2 ++ tests/Config/Plugin/Hook/MagicFunctionProvider.php | 2 ++ tests/Config/Plugin/MethodPlugin.php | 2 ++ tests/Config/Plugin/PropertyPlugin.php | 2 ++ tests/Config/Plugin/StoragePlugin.php | 2 ++ tests/Config/PluginListTest.php | 11 +++++------ tests/Config/PluginTest.php | 2 ++ tests/ConstValuesTest.php | 2 ++ tests/ConstantTest.php | 2 ++ tests/CoreStubsTest.php | 2 ++ tests/DateTimeTest.php | 2 ++ tests/DeprecatedAnnotationTest.php | 2 ++ tests/DocCommentTest.php | 2 ++ tests/DocblockInheritanceTest.php | 2 ++ tests/DocumentationTest.php | 12 ++++-------- tests/EndToEnd/DestructiveAutoloaderTest.php | 2 ++ tests/EndToEnd/PsalmEndToEndTest.php | 2 ++ tests/EndToEnd/PsalmRunnerTrait.php | 4 +++- tests/EndToEnd/SuicidalAutoloaderTest.php | 2 ++ tests/EnumTest.php | 2 ++ tests/ErrorBaselineTest.php | 5 +++-- tests/ExpressionTest.php | 2 ++ tests/ExtendsFinalClassTest.php | 2 ++ tests/ExtensionRequirementTest.php | 2 ++ tests/FileDiffTest.php | 6 ++++-- tests/FileManipulation/ClassConstantMoveTest.php | 4 +++- tests/FileManipulation/ClassMoveTest.php | 4 +++- tests/FileManipulation/FileManipulationTestCase.php | 4 +++- .../ImmutableAnnotationAdditionTest.php | 2 ++ tests/FileManipulation/MethodMoveTest.php | 4 +++- tests/FileManipulation/MissingPropertyTypeTest.php | 2 ++ tests/FileManipulation/MissingReturnTypeTest.php | 2 ++ tests/FileManipulation/NamespaceMoveTest.php | 4 +++- tests/FileManipulation/ParamNameMismatchTest.php | 2 ++ tests/FileManipulation/ParamTypeManipulationTest.php | 2 ++ tests/FileManipulation/PropertyMoveTest.php | 4 +++- .../FileManipulation/PureAnnotationAdditionTest.php | 2 ++ .../RedundantCastManipulationTest.php | 2 ++ .../FileManipulation/ReturnTypeManipulationTest.php | 2 ++ tests/FileManipulation/ThrowsBlockAdditionTest.php | 2 ++ .../UndefinedVariableManipulationTest.php | 2 ++ .../UnnecessaryVarAnnotationManipulationTest.php | 2 ++ .../FileManipulation/UnusedCodeManipulationTest.php | 2 ++ .../UnusedVariableManipulationTest.php | 2 ++ tests/FileReferenceTest.php | 4 +++- tests/FileUpdates/AnalyzedMethodTest.php | 4 +++- tests/FileUpdates/CachedStorageTest.php | 2 ++ tests/FileUpdates/ErrorAfterUpdateTest.php | 4 +++- tests/FileUpdates/ErrorFixTest.php | 4 +++- tests/FileUpdates/TemporaryUpdateTest.php | 4 +++- tests/ForbiddenCodeTest.php | 2 ++ tests/FunctionCallTest.php | 2 ++ tests/FunctionLikeDocblockParserTest.php | 2 ++ tests/GeneratorTest.php | 2 ++ tests/IfThisIsTest.php | 2 ++ tests/ImmutableAnnotationTest.php | 2 ++ tests/ImplementationRequirementTest.php | 2 ++ tests/IncludeTest.php | 6 ++++-- tests/IntRangeTest.php | 2 ++ tests/InterfaceTest.php | 2 ++ tests/Internal/CallMapTest.php | 2 ++ tests/Internal/CliUtilsTest.php | 2 ++ .../Internal/Codebase/InternalCallMapHandlerTest.php | 2 ++ .../ClassLikeStorageInstanceCacheProvider.php | 2 ++ .../Provider/FakeFileReferenceCacheProvider.php | 2 ++ tests/Internal/Provider/FakeParserCacheProvider.php | 2 ++ .../Provider/FileStorageInstanceCacheProvider.php | 2 ++ .../Provider/ParserInstanceCacheProvider.php | 2 ++ tests/Internal/Provider/ProjectCacheProvider.php | 2 ++ tests/Internal/Scanner/FileScannerTest.php | 4 +++- tests/InternalAnnotationTest.php | 2 ++ tests/IssueBufferTest.php | 2 ++ tests/IssueSuppressionTest.php | 2 ++ tests/JsonOutputTest.php | 4 +++- tests/LanguageServer/CompletionTest.php | 2 ++ tests/LanguageServer/DiagnosticTest.php | 2 ++ tests/LanguageServer/FileMapTest.php | 2 ++ tests/LanguageServer/Message.php | 2 ++ tests/LanguageServer/PathMapperTest.php | 6 ++++-- tests/LanguageServer/SymbolLookupTest.php | 4 +++- tests/ListTest.php | 2 ++ tests/Loop/DoTest.php | 2 ++ tests/Loop/ForTest.php | 2 ++ tests/Loop/ForeachTest.php | 2 ++ tests/Loop/WhileTest.php | 2 ++ tests/MagicMethodAnnotationTest.php | 2 ++ tests/MagicPropertyTest.php | 2 ++ tests/MatchTest.php | 2 ++ tests/MethodCallTest.php | 2 ++ tests/MethodMutationTest.php | 2 ++ tests/MethodSignatureTest.php | 2 ++ tests/MixinAnnotationTest.php | 2 ++ tests/NamespaceTest.php | 2 ++ tests/NativeIntersectionsTest.php | 2 ++ tests/NativeUnionsTest.php | 2 ++ tests/Php40Test.php | 2 ++ tests/Php55Test.php | 2 ++ tests/Php56Test.php | 2 ++ tests/Php70Test.php | 2 ++ tests/Php71Test.php | 2 ++ tests/Progress/EchoProgress.php | 2 ++ tests/ProjectCheckerTest.php | 2 ++ tests/PropertiesOfTest.php | 2 ++ tests/PropertyTypeInvarianceTest.php | 2 ++ tests/PropertyTypeTest.php | 2 ++ tests/PsalmPluginTest.php | 8 ++++---- tests/PureAnnotationTest.php | 2 ++ tests/PureCallableTest.php | 2 ++ tests/ReadonlyPropertyTest.php | 2 ++ tests/ReferenceConstraintTest.php | 2 ++ tests/ReferenceTest.php | 2 ++ tests/ReportOutputTest.php | 2 ++ tests/ReturnTypeProvider/ArrayColumnTest.php | 2 ++ tests/ReturnTypeProvider/ArraySliceTest.php | 2 ++ tests/ReturnTypeProvider/BasenameTest.php | 2 ++ tests/ReturnTypeProvider/DirnameTest.php | 2 ++ tests/ReturnTypeProvider/ExceptionCodeTest.php | 2 ++ tests/ReturnTypeProvider/InArrayTest.php | 2 ++ .../MinMaxReturnTypeProviderTest.php | 2 ++ .../ReturnTypeProvider/PowReturnTypeProviderTest.php | 2 ++ tests/ReturnTypeProvider/SprintfTest.php | 2 ++ tests/ReturnTypeTest.php | 2 ++ tests/StubTest.php | 2 ++ tests/SuperGlobalsTest.php | 2 ++ tests/SwitchTypeTest.php | 2 ++ tests/TaintTest.php | 2 ++ tests/Template/ClassStringMapTest.php | 2 ++ tests/Template/ClassTemplateCovarianceTest.php | 2 ++ tests/Template/ClassTemplateExtendsTest.php | 2 ++ tests/Template/ClassTemplateTest.php | 2 ++ tests/Template/ConditionalReturnTypeTest.php | 2 ++ tests/Template/FunctionClassStringTemplateTest.php | 2 ++ tests/Template/FunctionTemplateAssertTest.php | 2 ++ tests/Template/FunctionTemplateTest.php | 2 ++ tests/Template/NestedTemplateTest.php | 2 ++ tests/Template/PropertiesOfTemplateTest.php | 2 ++ tests/Template/TraitTemplateTest.php | 2 ++ tests/TestCase.php | 2 ++ tests/TestConfig.php | 2 ++ tests/TestEnvironmentTest.php | 2 ++ tests/ThisOutTest.php | 2 ++ tests/ThrowsAnnotationTest.php | 2 ++ tests/ThrowsInGlobalScopeTest.php | 2 ++ tests/ToStringTest.php | 2 ++ tests/TraceTest.php | 2 ++ tests/TraitTest.php | 2 ++ tests/Traits/InvalidCodeAnalysisTestTrait.php | 4 +++- tests/Traits/ValidCodeAnalysisTestTrait.php | 4 +++- tests/TryCatchTest.php | 2 ++ tests/TypeAnnotationTest.php | 2 ++ tests/TypeCombinationTest.php | 2 ++ tests/TypeComparatorTest.php | 2 ++ tests/TypeParseTest.php | 2 ++ tests/TypeReconciliation/ArrayKeyExistsTest.php | 2 ++ .../AssignmentInConditionalTest.php | 2 ++ tests/TypeReconciliation/ConditionalTest.php | 2 ++ tests/TypeReconciliation/EmptyTest.php | 2 ++ tests/TypeReconciliation/InArrayTest.php | 2 ++ tests/TypeReconciliation/IssetTest.php | 2 ++ tests/TypeReconciliation/ReconcilerTest.php | 2 ++ tests/TypeReconciliation/RedundantConditionTest.php | 2 ++ tests/TypeReconciliation/ScopeTest.php | 2 ++ tests/TypeReconciliation/TypeAlgebraTest.php | 2 ++ tests/TypeReconciliation/TypeTest.php | 2 ++ tests/TypeReconciliation/ValueTest.php | 2 ++ tests/UnresolvableIncludeTest.php | 2 ++ tests/UnusedCodeTest.php | 2 ++ tests/UnusedVariableTest.php | 2 ++ tests/VariadicTest.php | 2 ++ tests/somefile.php | 3 +++ 207 files changed, 449 insertions(+), 49 deletions(-) diff --git a/tests/AlgebraTest.php b/tests/AlgebraTest.php index e3ec6254a..24d96e9e2 100644 --- a/tests/AlgebraTest.php +++ b/tests/AlgebraTest.php @@ -1,5 +1,7 @@ inner->toString(); } - /** - * @param mixed $other - */ - protected function matches($other): bool + protected function matches(mixed $other): bool { return $this->inner->matches($other); } - /** - * @param mixed $other - */ - protected function failureDescription($other): string + protected function failureDescription(mixed $other): string { return $this->exporter()->shortenedExport($other) . ' ' . $this->toString(); } diff --git a/tests/EndToEnd/DestructiveAutoloaderTest.php b/tests/EndToEnd/DestructiveAutoloaderTest.php index 400efeec9..74a8a59e6 100644 --- a/tests/EndToEnd/DestructiveAutoloaderTest.php +++ b/tests/EndToEnd/DestructiveAutoloaderTest.php @@ -1,5 +1,7 @@ getTestName(), 'SKIPPED-') !== false) { $this->markTestSkipped(); @@ -84,7 +86,7 @@ class FileDiffTest extends TestCase array $same_methods, array $same_signatures, array $changed_methods, - array $diff_map_offsets + array $diff_map_offsets, ): void { if (strpos($this->getTestName(), 'SKIPPED-') !== false) { $this->markTestSkipped(); diff --git a/tests/FileManipulation/ClassConstantMoveTest.php b/tests/FileManipulation/ClassConstantMoveTest.php index f06239abb..3e22aa14a 100644 --- a/tests/FileManipulation/ClassConstantMoveTest.php +++ b/tests/FileManipulation/ClassConstantMoveTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileManipulation/ClassMoveTest.php b/tests/FileManipulation/ClassMoveTest.php index e49e0cf87..c2f5c8ee7 100644 --- a/tests/FileManipulation/ClassMoveTest.php +++ b/tests/FileManipulation/ClassMoveTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileManipulation/FileManipulationTestCase.php b/tests/FileManipulation/FileManipulationTestCase.php index de361f6ff..069412838 100644 --- a/tests/FileManipulation/FileManipulationTestCase.php +++ b/tests/FileManipulation/FileManipulationTestCase.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileManipulation/ImmutableAnnotationAdditionTest.php b/tests/FileManipulation/ImmutableAnnotationAdditionTest.php index 926cef22a..0e3083911 100644 --- a/tests/FileManipulation/ImmutableAnnotationAdditionTest.php +++ b/tests/FileManipulation/ImmutableAnnotationAdditionTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileManipulation/MissingPropertyTypeTest.php b/tests/FileManipulation/MissingPropertyTypeTest.php index afeb644ee..9fe744661 100644 --- a/tests/FileManipulation/MissingPropertyTypeTest.php +++ b/tests/FileManipulation/MissingPropertyTypeTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileManipulation/ParamNameMismatchTest.php b/tests/FileManipulation/ParamNameMismatchTest.php index 3dfd82d77..186885a43 100644 --- a/tests/FileManipulation/ParamNameMismatchTest.php +++ b/tests/FileManipulation/ParamNameMismatchTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileManipulation/PureAnnotationAdditionTest.php b/tests/FileManipulation/PureAnnotationAdditionTest.php index 3434481ad..2b44581a8 100644 --- a/tests/FileManipulation/PureAnnotationAdditionTest.php +++ b/tests/FileManipulation/PureAnnotationAdditionTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileUpdates/AnalyzedMethodTest.php b/tests/FileUpdates/AnalyzedMethodTest.php index 30e8f29fa..598efeb61 100644 --- a/tests/FileUpdates/AnalyzedMethodTest.php +++ b/tests/FileUpdates/AnalyzedMethodTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'SKIPPED-') !== false) { diff --git a/tests/FileUpdates/CachedStorageTest.php b/tests/FileUpdates/CachedStorageTest.php index 3e6b97bff..a41a33b86 100644 --- a/tests/FileUpdates/CachedStorageTest.php +++ b/tests/FileUpdates/CachedStorageTest.php @@ -1,5 +1,7 @@ project_analyzer->getCodebase()->diff_methods = true; $this->project_analyzer->getCodebase()->reportUnusedCode(); diff --git a/tests/FileUpdates/ErrorFixTest.php b/tests/FileUpdates/ErrorFixTest.php index 7ea00bafe..c6e9ffc01 100644 --- a/tests/FileUpdates/ErrorFixTest.php +++ b/tests/FileUpdates/ErrorFixTest.php @@ -1,5 +1,7 @@ project_analyzer->getCodebase()->diff_methods = true; diff --git a/tests/FileUpdates/TemporaryUpdateTest.php b/tests/FileUpdates/TemporaryUpdateTest.php index f8e1c0bf0..507b483f0 100644 --- a/tests/FileUpdates/TemporaryUpdateTest.php +++ b/tests/FileUpdates/TemporaryUpdateTest.php @@ -1,5 +1,7 @@ codebase; $codebase->diff_methods = true; diff --git a/tests/ForbiddenCodeTest.php b/tests/ForbiddenCodeTest.php index 86b36f527..0a1911b16 100644 --- a/tests/ForbiddenCodeTest.php +++ b/tests/ForbiddenCodeTest.php @@ -1,5 +1,7 @@ project_analyzer->getCodebase(); @@ -64,7 +66,7 @@ class IncludeTest extends TestCase array $files, array $files_to_check, string $error_message, - array $directories = [] + array $directories = [], ): void { if (strpos($this->getTestName(), 'SKIPPED-') !== false) { $this->markTestSkipped(); diff --git a/tests/IntRangeTest.php b/tests/IntRangeTest.php index c7c09ae2d..852710db8 100644 --- a/tests/IntRangeTest.php +++ b/tests/IntRangeTest.php @@ -1,5 +1,7 @@ addFile('somefile.php', $code); $this->analyzeFile('somefile.php', new Context()); diff --git a/tests/LanguageServer/CompletionTest.php b/tests/LanguageServer/CompletionTest.php index 942556f56..7e6cb52bd 100644 --- a/tests/LanguageServer/CompletionTest.php +++ b/tests/LanguageServer/CompletionTest.php @@ -1,5 +1,7 @@ configureClientRoot($client_root_provided_later); @@ -53,7 +55,7 @@ final class PathMapperTest extends TestCase ?string $client_root_preconfigured, string $client_root_provided_later, string $client_path, - string $server_path + string $server_path, ): void { $mapper = new PathMapper($server_root, $client_root_preconfigured); $mapper->configureClientRoot($client_root_provided_later); diff --git a/tests/LanguageServer/SymbolLookupTest.php b/tests/LanguageServer/SymbolLookupTest.php index d235bc334..a0a36cb5d 100644 --- a/tests/LanguageServer/SymbolLookupTest.php +++ b/tests/LanguageServer/SymbolLookupTest.php @@ -1,5 +1,7 @@ codebase->config; $config->throw_exception = false; diff --git a/tests/ListTest.php b/tests/ListTest.php index 5dce65e54..c36c4bac7 100644 --- a/tests/ListTest.php +++ b/tests/ListTest.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'PHP80-') !== false) { diff --git a/tests/Traits/ValidCodeAnalysisTestTrait.php b/tests/Traits/ValidCodeAnalysisTestTrait.php index b37acced3..e8b7ffce8 100644 --- a/tests/Traits/ValidCodeAnalysisTestTrait.php +++ b/tests/Traits/ValidCodeAnalysisTestTrait.php @@ -1,5 +1,7 @@ getTestName(); if (strpos($test_name, 'PHP80-') !== false) { diff --git a/tests/TryCatchTest.php b/tests/TryCatchTest.php index c83e2b091..87a714e23 100644 --- a/tests/TryCatchTest.php +++ b/tests/TryCatchTest.php @@ -1,5 +1,7 @@