diff --git a/examples/plugins/composer-based/echo-checker/PluginEntryPoint.php b/examples/plugins/composer-based/echo-checker/PluginEntryPoint.php index 1ed87f5db0e..075b260d9e6 100644 --- a/examples/plugins/composer-based/echo-checker/PluginEntryPoint.php +++ b/examples/plugins/composer-based/echo-checker/PluginEntryPoint.php @@ -1,12 +1,13 @@ registerHooksFromClass(EchoChecker::class); diff --git a/src/Psalm/FileBasedPluginAdapter.php b/src/Psalm/FileBasedPluginAdapter.php index 346f9538a14..8921c2e9d4f 100644 --- a/src/Psalm/FileBasedPluginAdapter.php +++ b/src/Psalm/FileBasedPluginAdapter.php @@ -3,6 +3,7 @@ use Psalm\Internal\Analyzer\ClassLikeAnalyzer; use Psalm\Internal\Scanner\FileScanner; +use Psalm\Plugin\RegistrationInterface; use SimpleXMLElement; use UnexpectedValueException; @@ -38,7 +39,7 @@ public function __construct(string $path, Config $config, Codebase $codebase) /** * @psalm-suppress PossiblyUnusedParam */ - public function __invoke(Plugin\RegistrationInterface $registration, ?SimpleXMLElement $config = null): void + public function __invoke(RegistrationInterface $registration, ?SimpleXMLElement $config = null): void { $fq_class_name = $this->getPluginClassForPath($this->path); diff --git a/src/Psalm/Internal/Cli/Psalm.php b/src/Psalm/Internal/Cli/Psalm.php index ec7668bf663..edfb49358c6 100644 --- a/src/Psalm/Internal/Cli/Psalm.php +++ b/src/Psalm/Internal/Cli/Psalm.php @@ -18,6 +18,7 @@ use Psalm\Internal\IncludeCollector; use Psalm\Internal\Provider; use Psalm\Internal\Provider\FileProvider; +use Psalm\Internal\Provider\ProjectCacheProvider; use Psalm\Internal\Stubs\Generator\StubsGenerator; use Psalm\IssueBuffer; use Psalm\Progress\DebugProgress; @@ -623,7 +624,7 @@ private static function initProviders(array $options, Config $config, string $cu $file_storage_cache_provider, $classlike_storage_cache_provider, new Provider\FileReferenceCacheProvider($config), - new Provider\ProjectCacheProvider(Composer::getLockFilePath($current_dir)) + new ProjectCacheProvider(Composer::getLockFilePath($current_dir)) ); } return $providers; diff --git a/src/Psalm/Report.php b/src/Psalm/Report.php index a57b2d30476..b27e38baaed 100644 --- a/src/Psalm/Report.php +++ b/src/Psalm/Report.php @@ -2,6 +2,7 @@ namespace Psalm; use Psalm\Internal\Analyzer\IssueData; +use Psalm\Report\ReportOptions; use function array_filter; use function htmlspecialchars; @@ -78,7 +79,7 @@ abstract class Report public function __construct( array $issues_data, array $fixable_issue_counts, - Report\ReportOptions $report_options, + ReportOptions $report_options, int $mixed_expression_count = 1, int $total_expression_count = 1 ) { diff --git a/tests/AnnotationTest.php b/tests/AnnotationTest.php index 53146b123ad..45c0e9135c0 100644 --- a/tests/AnnotationTest.php +++ b/tests/AnnotationTest.php @@ -4,13 +4,15 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class AnnotationTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function setUp(): void { diff --git a/tests/ArgTest.php b/tests/ArgTest.php index c19697bbcc4..623ce95e977 100644 --- a/tests/ArgTest.php +++ b/tests/ArgTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ArrayAccessTest.php b/tests/ArrayAccessTest.php index 086a8f527ff..cdf8d22bc01 100644 --- a/tests/ArrayAccessTest.php +++ b/tests/ArrayAccessTest.php @@ -4,13 +4,15 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class ArrayAccessTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testEnsureArrayOffsetsExist(): void { diff --git a/tests/ArrayAssignmentTest.php b/tests/ArrayAssignmentTest.php index ce2bf63b5ea..3400fbbacc4 100644 --- a/tests/ArrayAssignmentTest.php +++ b/tests/ArrayAssignmentTest.php @@ -2,12 +2,14 @@ namespace Psalm\Tests; use Psalm\Context; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use Psalm\Type; class ArrayAssignmentTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testConditionalAssignment(): void { diff --git a/tests/ArrayFunctionCallTest.php b/tests/ArrayFunctionCallTest.php index 5f214929d02..a2260ca3622 100644 --- a/tests/ArrayFunctionCallTest.php +++ b/tests/ArrayFunctionCallTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/AssertAnnotationTest.php b/tests/AssertAnnotationTest.php index e2ebe95ce41..94ff4f8e5c3 100644 --- a/tests/AssertAnnotationTest.php +++ b/tests/AssertAnnotationTest.php @@ -2,12 +2,15 @@ namespace Psalm\Tests; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; + use const DIRECTORY_SEPARATOR; class AssertAnnotationTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/AssignmentTest.php b/tests/AssignmentTest.php index 355e3a92b6e..bc5f53e6230 100644 --- a/tests/AssignmentTest.php +++ b/tests/AssignmentTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/AttributeTest.php b/tests/AttributeTest.php index 77ae6cefda3..a3b210e6901 100644 --- a/tests/AttributeTest.php +++ b/tests/AttributeTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/BinaryOperationTest.php b/tests/BinaryOperationTest.php index 661a1a9b1e2..26f1dd05b5c 100644 --- a/tests/BinaryOperationTest.php +++ b/tests/BinaryOperationTest.php @@ -4,6 +4,8 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use function class_exists; @@ -11,8 +13,8 @@ class BinaryOperationTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testGMPOperations(): void { diff --git a/tests/CallableTest.php b/tests/CallableTest.php index 77895a82ad3..83b42fff446 100644 --- a/tests/CallableTest.php +++ b/tests/CallableTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ClassLikeStringTest.php b/tests/ClassLikeStringTest.php index d2fb2527408..7feb59d96f3 100644 --- a/tests/ClassLikeStringTest.php +++ b/tests/ClassLikeStringTest.php @@ -4,11 +4,13 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class ClassLikeStringTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testDontAllowStringStandInForNewClass(): void { diff --git a/tests/ClassLoadOrderTest.php b/tests/ClassLoadOrderTest.php index dd65a961a2c..7ddd1a12a1f 100644 --- a/tests/ClassLoadOrderTest.php +++ b/tests/ClassLoadOrderTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ClassScopeTest.php b/tests/ClassScopeTest.php index 15a4d3f2b2e..bc12f4cbd30 100644 --- a/tests/ClassScopeTest.php +++ b/tests/ClassScopeTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ClassTest.php b/tests/ClassTest.php index e9cfeb3d9bf..d7541c09984 100644 --- a/tests/ClassTest.php +++ b/tests/ClassTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/ClosureTest.php b/tests/ClosureTest.php index 6049607db1d..0ee0acd0751 100644 --- a/tests/ClosureTest.php +++ b/tests/ClosureTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/Config/ConfigTest.php b/tests/Config/ConfigTest.php index 51b19774886..fc51ade8b8b 100644 --- a/tests/Config/ConfigTest.php +++ b/tests/Config/ConfigTest.php @@ -15,7 +15,7 @@ use Psalm\Internal\RuntimeCaches; use Psalm\Internal\Scanner\FileScanner; use Psalm\Tests\Config\Plugin\FileTypeSelfRegisteringPlugin; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -71,7 +71,7 @@ private function getProjectAnalyzerWithConfig(Config $config): ProjectAnalyzer $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/Config/Plugin/AfterAnalysisPlugin.php b/tests/Config/Plugin/AfterAnalysisPlugin.php index a4a279068a7..a33c219871c 100644 --- a/tests/Config/Plugin/AfterAnalysisPlugin.php +++ b/tests/Config/Plugin/AfterAnalysisPlugin.php @@ -1,17 +1,18 @@ registerHooksFromClass(Hook\AfterAnalysis::class); + $registration->registerHooksFromClass(AfterAnalysis::class); } } diff --git a/tests/Config/Plugin/FilePlugin.php b/tests/Config/Plugin/FilePlugin.php index 74e720b0baf..feadc41495c 100644 --- a/tests/Config/Plugin/FilePlugin.php +++ b/tests/Config/Plugin/FilePlugin.php @@ -1,17 +1,18 @@ registerHooksFromClass(Hook\FileProvider::class); + $registration->registerHooksFromClass(FileProvider::class); } } diff --git a/tests/Config/Plugin/FileTypeSelfRegisteringPlugin.php b/tests/Config/Plugin/FileTypeSelfRegisteringPlugin.php index 01d147fa89b..85edcbd50ad 100644 --- a/tests/Config/Plugin/FileTypeSelfRegisteringPlugin.php +++ b/tests/Config/Plugin/FileTypeSelfRegisteringPlugin.php @@ -1,8 +1,8 @@ registerHooksFromClass(Hook\MagicFunctionProvider::class); + $registration->registerHooksFromClass(MagicFunctionProvider::class); } } diff --git a/tests/Config/Plugin/Hook/SqlStringProvider.php b/tests/Config/Plugin/Hook/SqlStringProvider.php index f0d6d4b9ba2..648af9bc6f4 100644 --- a/tests/Config/Plugin/Hook/SqlStringProvider.php +++ b/tests/Config/Plugin/Hook/SqlStringProvider.php @@ -4,6 +4,7 @@ use PhpMyAdmin\SqlParser\Parser; use Psalm\Plugin\EventHandler\Event\StringInterpreterEvent; use Psalm\Plugin\EventHandler\StringInterpreterInterface; +use Psalm\Test\Config\Plugin\Hook\StringProvider\TSqlSelectString; use Psalm\Type\Atomic\TLiteralString; use Throwable; @@ -19,7 +20,7 @@ public static function getTypeFromValue(StringInterpreterEvent $event) : ?TLiter $parser = new Parser($value); if (!$parser->errors) { - return new StringProvider\TSqlSelectString($value); + return new TSqlSelectString($value); } } catch (Throwable $e) { // fall through diff --git a/tests/Config/Plugin/MethodPlugin.php b/tests/Config/Plugin/MethodPlugin.php index 054544554be..310593c9923 100644 --- a/tests/Config/Plugin/MethodPlugin.php +++ b/tests/Config/Plugin/MethodPlugin.php @@ -1,17 +1,18 @@ registerHooksFromClass(Hook\FooMethodProvider::class); + $registration->registerHooksFromClass(FooMethodProvider::class); } } diff --git a/tests/Config/Plugin/PropertyPlugin.php b/tests/Config/Plugin/PropertyPlugin.php index 21663fee8f7..bd52f1239a4 100644 --- a/tests/Config/Plugin/PropertyPlugin.php +++ b/tests/Config/Plugin/PropertyPlugin.php @@ -1,17 +1,18 @@ registerHooksFromClass(Hook\FooPropertyProvider::class); + $registration->registerHooksFromClass(FooPropertyProvider::class); } } diff --git a/tests/Config/Plugin/SqlStringProviderPlugin.php b/tests/Config/Plugin/SqlStringProviderPlugin.php index d41a6c42e56..4424b29ee7d 100644 --- a/tests/Config/Plugin/SqlStringProviderPlugin.php +++ b/tests/Config/Plugin/SqlStringProviderPlugin.php @@ -1,18 +1,19 @@ registerHooksFromClass(Hook\SqlStringProvider::class); + $registration->registerHooksFromClass(SqlStringProvider::class); } } diff --git a/tests/Config/PluginTest.php b/tests/Config/PluginTest.php index ecedbf33b9f..f0c4d6eec07 100644 --- a/tests/Config/PluginTest.php +++ b/tests/Config/PluginTest.php @@ -28,7 +28,7 @@ use Psalm\StatementsSource; use Psalm\Storage\ClassLikeStorage; use Psalm\Test\Config\Plugin\Hook\StringProvider\TSqlSelectString; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; use Psalm\Type\Union; @@ -77,7 +77,7 @@ private function getProjectAnalyzerWithConfig(Config $config): ProjectAnalyzer $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ), new ReportOptions() ); diff --git a/tests/ConstValuesTest.php b/tests/ConstValuesTest.php index 23d251752da..b453dd77373 100644 --- a/tests/ConstValuesTest.php +++ b/tests/ConstValuesTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ConstantTest.php b/tests/ConstantTest.php index 516cfdad595..a462cc4cd60 100644 --- a/tests/ConstantTest.php +++ b/tests/ConstantTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[], php_version?: string}> diff --git a/tests/CoreStubsTest.php b/tests/CoreStubsTest.php index d29ee967b07..cdae517166c 100644 --- a/tests/CoreStubsTest.php +++ b/tests/CoreStubsTest.php @@ -2,9 +2,11 @@ namespace Psalm\Tests; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; + class CoreStubsTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/DeprecatedAnnotationTest.php b/tests/DeprecatedAnnotationTest.php index c703542b834..2e9db69a919 100644 --- a/tests/DeprecatedAnnotationTest.php +++ b/tests/DeprecatedAnnotationTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/DocblockInheritanceTest.php b/tests/DocblockInheritanceTest.php index 9fabfa5e42c..f59d822b5e3 100644 --- a/tests/DocblockInheritanceTest.php +++ b/tests/DocblockInheritanceTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/DocumentationTest.php b/tests/DocumentationTest.php index 00d1ce18b97..f23370f45b8 100644 --- a/tests/DocumentationTest.php +++ b/tests/DocumentationTest.php @@ -15,7 +15,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use UnexpectedValueException; use function array_filter; @@ -137,7 +137,7 @@ public function setUp() : void new TestConfig(), new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/EnumTest.php b/tests/EnumTest.php index 98f7d540dcc..7eb56dfe402 100644 --- a/tests/EnumTest.php +++ b/tests/EnumTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ExtendsFinalClassTest.php b/tests/ExtendsFinalClassTest.php index 7109f0b87f9..d9c8d6fe19a 100644 --- a/tests/ExtendsFinalClassTest.php +++ b/tests/ExtendsFinalClassTest.php @@ -2,10 +2,13 @@ namespace Psalm\Tests; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; + class ExtendsFinalClassTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/ExtensionRequirementTest.php b/tests/ExtensionRequirementTest.php index 235164a27ba..cb29bd16c83 100644 --- a/tests/ExtensionRequirementTest.php +++ b/tests/ExtensionRequirementTest.php @@ -2,10 +2,13 @@ namespace Psalm\Tests; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; + class ExtensionRequirementTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; public function setUp(): void { diff --git a/tests/FileManipulation/ClassConstantMoveTest.php b/tests/FileManipulation/ClassConstantMoveTest.php index 81000219b20..2b5f0174a05 100644 --- a/tests/FileManipulation/ClassConstantMoveTest.php +++ b/tests/FileManipulation/ClassConstantMoveTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -45,7 +45,7 @@ public function testValidCode( $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileManipulation/ClassMoveTest.php b/tests/FileManipulation/ClassMoveTest.php index 1889d9bf58e..045ed28c395 100644 --- a/tests/FileManipulation/ClassMoveTest.php +++ b/tests/FileManipulation/ClassMoveTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -45,7 +45,7 @@ public function testValidCode( $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileManipulation/FileManipulationTestCase.php b/tests/FileManipulation/FileManipulationTestCase.php index a862d6208ea..d478364fe45 100644 --- a/tests/FileManipulation/FileManipulationTestCase.php +++ b/tests/FileManipulation/FileManipulationTestCase.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -53,7 +53,7 @@ public function testValidCode( $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileManipulation/MethodMoveTest.php b/tests/FileManipulation/MethodMoveTest.php index e61b8727da8..1b9c0334b10 100644 --- a/tests/FileManipulation/MethodMoveTest.php +++ b/tests/FileManipulation/MethodMoveTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -45,7 +45,7 @@ public function testValidCode( $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileManipulation/NamespaceMoveTest.php b/tests/FileManipulation/NamespaceMoveTest.php index cb7c9974d7d..502e24651d5 100644 --- a/tests/FileManipulation/NamespaceMoveTest.php +++ b/tests/FileManipulation/NamespaceMoveTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -45,7 +45,7 @@ public function testValidCode( $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileManipulation/PropertyMoveTest.php b/tests/FileManipulation/PropertyMoveTest.php index 1320173d765..e5e9f517f31 100644 --- a/tests/FileManipulation/PropertyMoveTest.php +++ b/tests/FileManipulation/PropertyMoveTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -45,7 +45,7 @@ public function testValidCode( $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileReferenceTest.php b/tests/FileReferenceTest.php index 4992f2a6ff8..e7e59387b06 100644 --- a/tests/FileReferenceTest.php +++ b/tests/FileReferenceTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use UnexpectedValueException; use function count; @@ -27,7 +27,7 @@ public function setUp() : void new TestConfig(), new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FileUpdates/AnalyzedMethodTest.php b/tests/FileUpdates/AnalyzedMethodTest.php index 7c6610a4bd5..3b91cedcd0b 100644 --- a/tests/FileUpdates/AnalyzedMethodTest.php +++ b/tests/FileUpdates/AnalyzedMethodTest.php @@ -5,7 +5,7 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -32,7 +32,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/FileUpdates/CachedStorageTest.php b/tests/FileUpdates/CachedStorageTest.php index 5edfe567296..f19f84a23a5 100644 --- a/tests/FileUpdates/CachedStorageTest.php +++ b/tests/FileUpdates/CachedStorageTest.php @@ -4,7 +4,11 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\ClassLikeStorageInstanceCacheProvider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; +use Psalm\Tests\Internal\Provider\FileStorageInstanceCacheProvider; +use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; +use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; use Psalm\Tests\TestConfig; @@ -26,11 +30,11 @@ public function setUp() : void $providers = new Providers( $this->file_provider, - new Provider\ParserInstanceCacheProvider(), - new Provider\FileStorageInstanceCacheProvider(), - new Provider\ClassLikeStorageInstanceCacheProvider(), - new Provider\FakeFileReferenceCacheProvider(), - new Provider\ProjectCacheProvider() + new ParserInstanceCacheProvider(), + new FileStorageInstanceCacheProvider(), + new ClassLikeStorageInstanceCacheProvider(), + new FakeFileReferenceCacheProvider(), + new ProjectCacheProvider() ); $this->project_analyzer = new ProjectAnalyzer( diff --git a/tests/FileUpdates/ErrorAfterUpdateTest.php b/tests/FileUpdates/ErrorAfterUpdateTest.php index a02fe22a946..49e3c70104e 100644 --- a/tests/FileUpdates/ErrorAfterUpdateTest.php +++ b/tests/FileUpdates/ErrorAfterUpdateTest.php @@ -5,7 +5,7 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -34,7 +34,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/FileUpdates/ErrorFixTest.php b/tests/FileUpdates/ErrorFixTest.php index 66efe3577cd..406be8fc11b 100644 --- a/tests/FileUpdates/ErrorFixTest.php +++ b/tests/FileUpdates/ErrorFixTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\IssueBuffer; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -34,7 +34,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/FileUpdates/TemporaryUpdateTest.php b/tests/FileUpdates/TemporaryUpdateTest.php index 2db113b0d58..689278e9d09 100644 --- a/tests/FileUpdates/TemporaryUpdateTest.php +++ b/tests/FileUpdates/TemporaryUpdateTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\IssueBuffer; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -37,7 +37,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/ForbiddenCodeTest.php b/tests/ForbiddenCodeTest.php index 8aef351f1db..d4ba2e2152e 100644 --- a/tests/ForbiddenCodeTest.php +++ b/tests/ForbiddenCodeTest.php @@ -7,15 +7,17 @@ use Psalm\Exception\CodeException; use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use function dirname; use function getcwd; class ForbiddenCodeTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable @@ -360,7 +362,7 @@ private function getProjectAnalyzerWithConfig(Config $config): ProjectAnalyzer $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/FunctionCallTest.php b/tests/FunctionCallTest.php index 99cd24ed623..8bc32b714a2 100644 --- a/tests/FunctionCallTest.php +++ b/tests/FunctionCallTest.php @@ -3,13 +3,15 @@ use Psalm\Config; use Psalm\Context; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class FunctionCallTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/GeneratorTest.php b/tests/GeneratorTest.php index d32a4837423..55208c791d5 100644 --- a/tests/GeneratorTest.php +++ b/tests/GeneratorTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/IfThisIsTest.php b/tests/IfThisIsTest.php index 7d3ea95d103..27b5889d9ea 100644 --- a/tests/IfThisIsTest.php +++ b/tests/IfThisIsTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> @@ -119,7 +122,7 @@ public function providerInvalidCodeParse(): iterable return [ 'failsWithWrongTemplate1' => [ ',error_levels?:string[]}> diff --git a/tests/ImplementationRequirementTest.php b/tests/ImplementationRequirementTest.php index 2984e8a9f5b..e85f2af8a1a 100644 --- a/tests/ImplementationRequirementTest.php +++ b/tests/ImplementationRequirementTest.php @@ -2,10 +2,13 @@ namespace Psalm\Tests; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; + class ImplementationRequirementTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; public function setUp(): void { diff --git a/tests/IntRangeTest.php b/tests/IntRangeTest.php index b6b5919b9c1..3bae2776185 100644 --- a/tests/IntRangeTest.php +++ b/tests/IntRangeTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/InterfaceTest.php b/tests/InterfaceTest.php index f783fc2eeab..cb802cd0e86 100644 --- a/tests/InterfaceTest.php +++ b/tests/InterfaceTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/InternalAnnotationTest.php b/tests/InternalAnnotationTest.php index 169d3511284..0cf04fa95dd 100644 --- a/tests/InternalAnnotationTest.php +++ b/tests/InternalAnnotationTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/IssueSuppressionTest.php b/tests/IssueSuppressionTest.php index 49900770f9f..eac4301fc32 100644 --- a/tests/IssueSuppressionTest.php +++ b/tests/IssueSuppressionTest.php @@ -4,6 +4,8 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use function getcwd; @@ -11,8 +13,8 @@ class IssueSuppressionTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; public function testIssueSuppressedOnFunction(): void { diff --git a/tests/JsonOutputTest.php b/tests/JsonOutputTest.php index 1b010044e22..b5a74427419 100644 --- a/tests/JsonOutputTest.php +++ b/tests/JsonOutputTest.php @@ -9,7 +9,7 @@ use Psalm\IssueBuffer; use Psalm\Report; use Psalm\Report\ReportOptions; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use function substr; @@ -32,7 +32,7 @@ public function setUp() : void $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ), $stdout_report_options ); diff --git a/tests/LanguageServer/CompletionTest.php b/tests/LanguageServer/CompletionTest.php index ccda5be3884..37bbe5ff7d3 100644 --- a/tests/LanguageServer/CompletionTest.php +++ b/tests/LanguageServer/CompletionTest.php @@ -6,7 +6,7 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -30,7 +30,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/LanguageServer/FileMapTest.php b/tests/LanguageServer/FileMapTest.php index 5dcda678b75..d5bc0d14c69 100644 --- a/tests/LanguageServer/FileMapTest.php +++ b/tests/LanguageServer/FileMapTest.php @@ -5,7 +5,7 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -28,7 +28,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/LanguageServer/SymbolLookupTest.php b/tests/LanguageServer/SymbolLookupTest.php index b0cf244e9ba..504245fbcee 100644 --- a/tests/LanguageServer/SymbolLookupTest.php +++ b/tests/LanguageServer/SymbolLookupTest.php @@ -7,7 +7,7 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\TestCase; @@ -28,7 +28,7 @@ public function setUp() : void new ParserInstanceCacheProvider(), null, null, - new Provider\FakeFileReferenceCacheProvider(), + new FakeFileReferenceCacheProvider(), new ProjectCacheProvider() ); diff --git a/tests/ListTest.php b/tests/ListTest.php index 7e06b81105d..50dec560d95 100644 --- a/tests/ListTest.php +++ b/tests/ListTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/Loop/DoTest.php b/tests/Loop/DoTest.php index b2c84144afb..f6cb6155fc7 100644 --- a/tests/Loop/DoTest.php +++ b/tests/Loop/DoTest.php @@ -2,14 +2,15 @@ namespace Psalm\Tests\Loop; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class DoTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Loop/ForTest.php b/tests/Loop/ForTest.php index abb5e24b20d..76b582df90e 100644 --- a/tests/Loop/ForTest.php +++ b/tests/Loop/ForTest.php @@ -2,14 +2,15 @@ namespace Psalm\Tests\Loop; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class ForTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Loop/ForeachTest.php b/tests/Loop/ForeachTest.php index 23a522757d0..ec8bfb754ac 100644 --- a/tests/Loop/ForeachTest.php +++ b/tests/Loop/ForeachTest.php @@ -2,14 +2,15 @@ namespace Psalm\Tests\Loop; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class ForeachTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Loop/WhileTest.php b/tests/Loop/WhileTest.php index 727e6ab0726..301416a6e67 100644 --- a/tests/Loop/WhileTest.php +++ b/tests/Loop/WhileTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Loop; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class WhileTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/MagicMethodAnnotationTest.php b/tests/MagicMethodAnnotationTest.php index ce14df7cf4f..3472164c08c 100644 --- a/tests/MagicMethodAnnotationTest.php +++ b/tests/MagicMethodAnnotationTest.php @@ -4,13 +4,15 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class MagicMethodAnnotationTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testPhpDocMethodWhenUndefined(): void { diff --git a/tests/MagicPropertyTest.php b/tests/MagicPropertyTest.php index 5eca8397f36..e6ba3ed6382 100644 --- a/tests/MagicPropertyTest.php +++ b/tests/MagicPropertyTest.php @@ -3,13 +3,15 @@ use Psalm\Config; use Psalm\Context; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class MagicPropertyTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testPhpDocPropertyWithoutGet(): void { @@ -1148,9 +1150,9 @@ function getFoo(GetterSetter $o) : void { ], 'propertyDocblockOnProperty' => [ ' 'InvalidDocblock' ], diff --git a/tests/MatchTest.php b/tests/MatchTest.php index 54785b530f2..1c58dedf823 100644 --- a/tests/MatchTest.php +++ b/tests/MatchTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/MethodCallTest.php b/tests/MethodCallTest.php index 3091e3e0e69..bc3797851db 100644 --- a/tests/MethodCallTest.php +++ b/tests/MethodCallTest.php @@ -2,6 +2,8 @@ namespace Psalm\Tests; use Psalm\Context; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use function class_exists; @@ -9,8 +11,8 @@ class MethodCallTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testExtendDocblockParamType(): void { diff --git a/tests/MethodSignatureTest.php b/tests/MethodSignatureTest.php index cd13057f3a7..473a2fef8d0 100644 --- a/tests/MethodSignatureTest.php +++ b/tests/MethodSignatureTest.php @@ -3,6 +3,8 @@ use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use function class_exists; @@ -10,8 +12,8 @@ class MethodSignatureTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; public function testExtendSoapClientWithDocblockTypes(): void { diff --git a/tests/MixinAnnotationTest.php b/tests/MixinAnnotationTest.php index b444a904e43..8ae13aa8930 100644 --- a/tests/MixinAnnotationTest.php +++ b/tests/MixinAnnotationTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/NamespaceTest.php b/tests/NamespaceTest.php index cc24c8c5cf5..6bd60fd07dc 100644 --- a/tests/NamespaceTest.php +++ b/tests/NamespaceTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/Php40Test.php b/tests/Php40Test.php index 323698d4e17..6de140b21b7 100644 --- a/tests/Php40Test.php +++ b/tests/Php40Test.php @@ -1,9 +1,11 @@ ,error_levels?:string[]}> diff --git a/tests/Php55Test.php b/tests/Php55Test.php index bb4e1290f15..af843ad77d0 100644 --- a/tests/Php55Test.php +++ b/tests/Php55Test.php @@ -1,9 +1,11 @@ ,error_levels?:string[]}> diff --git a/tests/Php56Test.php b/tests/Php56Test.php index 7ea0aa920f5..99d59f125ad 100644 --- a/tests/Php56Test.php +++ b/tests/Php56Test.php @@ -1,9 +1,11 @@ ,error_levels?:string[]}> diff --git a/tests/Php70Test.php b/tests/Php70Test.php index 996898e609d..edfbdaa338e 100644 --- a/tests/Php70Test.php +++ b/tests/Php70Test.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/Php71Test.php b/tests/Php71Test.php index ecc0c0aa8ee..2ce176220dc 100644 --- a/tests/Php71Test.php +++ b/tests/Php71Test.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ProjectCheckerTest.php b/tests/ProjectCheckerTest.php index 311d1f5824c..abe7a78ae72 100644 --- a/tests/ProjectCheckerTest.php +++ b/tests/ProjectCheckerTest.php @@ -12,7 +12,11 @@ use Psalm\Plugin\EventHandler\Event\AfterCodebasePopulatedEvent; use Psalm\Report; use Psalm\Report\ReportOptions; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\ClassLikeStorageInstanceCacheProvider; +use Psalm\Tests\Internal\Provider\FakeFileReferenceCacheProvider; +use Psalm\Tests\Internal\Provider\FileStorageInstanceCacheProvider; +use Psalm\Tests\Internal\Provider\ParserInstanceCacheProvider; +use Psalm\Tests\Internal\Provider\ProjectCacheProvider; use Psalm\Tests\Progress\EchoProgress; use function define; @@ -61,11 +65,11 @@ private function getProjectAnalyzerWithConfig(Config $config): ProjectAnalyzer $config, new Providers( $this->file_provider, - new Provider\ParserInstanceCacheProvider(), - new Provider\FileStorageInstanceCacheProvider(), - new Provider\ClassLikeStorageInstanceCacheProvider(), - new Provider\FakeFileReferenceCacheProvider(), - new Provider\ProjectCacheProvider() + new ParserInstanceCacheProvider(), + new FileStorageInstanceCacheProvider(), + new ClassLikeStorageInstanceCacheProvider(), + new FakeFileReferenceCacheProvider(), + new ProjectCacheProvider() ), new ReportOptions() ); diff --git a/tests/PropertyTypeInvarianceTest.php b/tests/PropertyTypeInvarianceTest.php index 2130d92be05..8b23d98ccf3 100644 --- a/tests/PropertyTypeInvarianceTest.php +++ b/tests/PropertyTypeInvarianceTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/PropertyTypeTest.php b/tests/PropertyTypeTest.php index 5a6a419b45e..87bfa085079 100644 --- a/tests/PropertyTypeTest.php +++ b/tests/PropertyTypeTest.php @@ -5,13 +5,15 @@ use Psalm\Config; use Psalm\Context; use Psalm\Exception\CodeException; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class PropertyTypeTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testForgetPropertyAssignments(): void { diff --git a/tests/PureAnnotationTest.php b/tests/PureAnnotationTest.php index 5476c17ede0..fc3afe3f767 100644 --- a/tests/PureAnnotationTest.php +++ b/tests/PureAnnotationTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/PureCallableTest.php b/tests/PureCallableTest.php index b62d4b1a691..c7531c1e789 100644 --- a/tests/PureCallableTest.php +++ b/tests/PureCallableTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ReadonlyPropertyTest.php b/tests/ReadonlyPropertyTest.php index 8bec3192352..917fea0d1e2 100644 --- a/tests/ReadonlyPropertyTest.php +++ b/tests/ReadonlyPropertyTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/ReferenceConstraintTest.php b/tests/ReferenceConstraintTest.php index 4c2cea9e623..a70b3bacbe9 100644 --- a/tests/ReferenceConstraintTest.php +++ b/tests/ReferenceConstraintTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/ReportOutputTest.php b/tests/ReportOutputTest.php index 1dcc51c8f2a..be563437d21 100644 --- a/tests/ReportOutputTest.php +++ b/tests/ReportOutputTest.php @@ -14,7 +14,7 @@ use Psalm\Report; use Psalm\Report\JsonReport; use Psalm\Report\ReportOptions; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use UnexpectedValueException; use function file_get_contents; @@ -43,9 +43,9 @@ public function setUp() : void $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ), - new Report\ReportOptions(), + new ReportOptions(), $json_report_options ); } @@ -992,7 +992,7 @@ public function testConsoleReport(): void { $this->analyzeFileForReport(); - $console_report_options = new Report\ReportOptions(); + $console_report_options = new ReportOptions(); $console_report_options->use_color = false; $this->assertSame( @@ -1020,7 +1020,7 @@ public function testConsoleReportNoInfo(): void { $this->analyzeFileForReport(); - $console_report_options = new Report\ReportOptions(); + $console_report_options = new ReportOptions(); $console_report_options->use_color = false; $console_report_options->show_info = false; @@ -1046,7 +1046,7 @@ public function testConsoleReportNoSnippet(): void { $this->analyzeFileForReport(); - $console_report_options = new Report\ReportOptions(); + $console_report_options = new ReportOptions(); $console_report_options->show_snippet = false; $console_report_options->use_color = false; @@ -1075,7 +1075,7 @@ public function testConsoleReportWithLinks(): void { $this->analyzeFileForReport(); - $console_report_options = new Report\ReportOptions(); + $console_report_options = new ReportOptions(); $console_report_options->show_snippet = false; $console_report_options->use_color = true; @@ -1091,7 +1091,7 @@ public function testCompactReport(): void { $this->analyzeFileForReport(); - $compact_report_options = new Report\ReportOptions(); + $compact_report_options = new ReportOptions(); $compact_report_options->format = Report::TYPE_COMPACT; $compact_report_options->use_color = false; diff --git a/tests/ReturnTypeTest.php b/tests/ReturnTypeTest.php index 9cb96d4bbd6..b83d7d5571d 100644 --- a/tests/ReturnTypeTest.php +++ b/tests/ReturnTypeTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/StubTest.php b/tests/StubTest.php index fe1a9f747fa..8dfffe62a9b 100644 --- a/tests/StubTest.php +++ b/tests/StubTest.php @@ -12,7 +12,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use function define; use function defined; @@ -54,7 +54,7 @@ private function getProjectAnalyzerWithConfig(Config $config): ProjectAnalyzer $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); $project_analyzer->setPhpVersion('7.4', 'tests'); diff --git a/tests/SuperGlobalsTest.php b/tests/SuperGlobalsTest.php index a5e6518f774..d13919f2345 100644 --- a/tests/SuperGlobalsTest.php +++ b/tests/SuperGlobalsTest.php @@ -2,9 +2,11 @@ namespace Psalm\Tests; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; + class SuperGlobalsTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/SwitchTypeTest.php b/tests/SwitchTypeTest.php index c8e6872c7e0..85b6df4cee2 100644 --- a/tests/SwitchTypeTest.php +++ b/tests/SwitchTypeTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/Template/ClassStringMapTest.php b/tests/Template/ClassStringMapTest.php index afc606a4c10..a828e429d8c 100644 --- a/tests/Template/ClassStringMapTest.php +++ b/tests/Template/ClassStringMapTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class ClassStringMapTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/ClassTemplateCovarianceTest.php b/tests/Template/ClassTemplateCovarianceTest.php index c903728caf0..88e6e91605d 100644 --- a/tests/Template/ClassTemplateCovarianceTest.php +++ b/tests/Template/ClassTemplateCovarianceTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class ClassTemplateCovarianceTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/ClassTemplateExtendsTest.php b/tests/Template/ClassTemplateExtendsTest.php index ccb5d5b388b..23b6aaf54e3 100644 --- a/tests/Template/ClassTemplateExtendsTest.php +++ b/tests/Template/ClassTemplateExtendsTest.php @@ -2,14 +2,15 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class ClassTemplateExtendsTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> @@ -4434,15 +4435,15 @@ public function foo(): string { 'templateExtendsFewerTemplateParameters' => [ 'ret(); - + $b = new b(123, new RealE); $resultB = $b->ret(); - + $c1 = new c1(new RealE); $resultC1 = $c1->ret(); - + $c2 = new c2(false, new RealE); $resultC2 = $c2->ret(); - - + + class Secondary {} - + $c3 = new c3(new Secondary, new RealE); $resultC3 = $c3->ret(); ', diff --git a/tests/Template/ClassTemplateTest.php b/tests/Template/ClassTemplateTest.php index dbd7b9cd17b..04c5260f8bf 100644 --- a/tests/Template/ClassTemplateTest.php +++ b/tests/Template/ClassTemplateTest.php @@ -2,14 +2,15 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use const DIRECTORY_SEPARATOR; class ClassTemplateTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/ConditionalReturnTypeTest.php b/tests/Template/ConditionalReturnTypeTest.php index 89f17223a72..a14928d5003 100644 --- a/tests/Template/ConditionalReturnTypeTest.php +++ b/tests/Template/ConditionalReturnTypeTest.php @@ -2,11 +2,11 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class ConditionalReturnTypeTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/FunctionClassStringTemplateTest.php b/tests/Template/FunctionClassStringTemplateTest.php index b6cb7098c78..8b733397aef 100644 --- a/tests/Template/FunctionClassStringTemplateTest.php +++ b/tests/Template/FunctionClassStringTemplateTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class FunctionClassStringTemplateTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/FunctionTemplateAssertTest.php b/tests/Template/FunctionTemplateAssertTest.php index af49e456969..9a778f9cecc 100644 --- a/tests/Template/FunctionTemplateAssertTest.php +++ b/tests/Template/FunctionTemplateAssertTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class FunctionTemplateAssertTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/FunctionTemplateTest.php b/tests/Template/FunctionTemplateTest.php index 92958b3aa5c..828f6509a37 100644 --- a/tests/Template/FunctionTemplateTest.php +++ b/tests/Template/FunctionTemplateTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class FunctionTemplateTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/NestedTemplateTest.php b/tests/Template/NestedTemplateTest.php index 6af04f91b1b..fd89c55e89b 100644 --- a/tests/Template/NestedTemplateTest.php +++ b/tests/Template/NestedTemplateTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class NestedTemplateTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/Template/TraitTemplateTest.php b/tests/Template/TraitTemplateTest.php index ea0422d04b6..c8b277f76f1 100644 --- a/tests/Template/TraitTemplateTest.php +++ b/tests/Template/TraitTemplateTest.php @@ -2,12 +2,13 @@ namespace Psalm\Tests\Template; use Psalm\Tests\TestCase; -use Psalm\Tests\Traits; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class TraitTemplateTest extends TestCase { - use Traits\InvalidCodeAnalysisTestTrait; - use Traits\ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> @@ -487,22 +488,22 @@ public function bar(callable $callback): int { return $callback($this->get()); } } - + /** * @template B */ class Bar { - + /** * @use Foo */ use Foo; - + /** * @param B $value */ public function __construct(public mixed $value) { } - + /** * @return B */ diff --git a/tests/TestCase.php b/tests/TestCase.php index fa70492ec96..47d9739e52e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -12,7 +12,7 @@ use Psalm\Internal\Type\TypeParser; use Psalm\Internal\Type\TypeTokenizer; use Psalm\IssueBuffer; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use Psalm\Type\Union; use RuntimeException; use Throwable; @@ -76,7 +76,7 @@ public function setUp() : void $providers = new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ); $this->project_analyzer = new ProjectAnalyzer( diff --git a/tests/TestConfig.php b/tests/TestConfig.php index 3920261762c..83ffa5c5467 100644 --- a/tests/TestConfig.php +++ b/tests/TestConfig.php @@ -2,6 +2,7 @@ namespace Psalm\Tests; use Psalm\Config; +use Psalm\Config\ProjectFileFilter; use Psalm\Internal\IncludeCollector; use SimpleXMLElement; @@ -11,7 +12,7 @@ class TestConfig extends Config { - /** @var Config\ProjectFileFilter|null */ + /** @var ProjectFileFilter|null */ private static $cached_project_files = null; /** @@ -29,7 +30,7 @@ public function __construct() $this->base_dir = getcwd() . DIRECTORY_SEPARATOR; if (!self::$cached_project_files) { - self::$cached_project_files = Config\ProjectFileFilter::loadFromXMLElement( + self::$cached_project_files = ProjectFileFilter::loadFromXMLElement( new SimpleXMLElement($this->getContents()), $this->base_dir, true diff --git a/tests/ThisOutTest.php b/tests/ThisOutTest.php index b27d3dc200d..937c81b01e0 100644 --- a/tests/ThisOutTest.php +++ b/tests/ThisOutTest.php @@ -1,9 +1,11 @@ ,error_levels?:string[]}> @@ -70,7 +72,7 @@ public function addData($data): void { */ public function getData(): array { return $this->data; } } - + $a = new container(1); $data1 = $a->getData(); $a->setData(2); diff --git a/tests/ToStringTest.php b/tests/ToStringTest.php index 26ecaaad240..505789211bc 100644 --- a/tests/ToStringTest.php +++ b/tests/ToStringTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/TraceTest.php b/tests/TraceTest.php index ef823f72b28..595c722d5d8 100644 --- a/tests/TraceTest.php +++ b/tests/TraceTest.php @@ -1,9 +1,11 @@ diff --git a/tests/TraitTest.php b/tests/TraitTest.php index ce1b700ffb7..6fccb44feaf 100644 --- a/tests/TraitTest.php +++ b/tests/TraitTest.php @@ -1,12 +1,15 @@ ,error_levels?:string[]}> diff --git a/tests/TryCatchTest.php b/tests/TryCatchTest.php index 46db39c521a..8e9e5b72555 100644 --- a/tests/TryCatchTest.php +++ b/tests/TryCatchTest.php @@ -2,11 +2,13 @@ namespace Psalm\Tests; use Psalm\Config; +use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; class TryCatchTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; - use Traits\InvalidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; + use InvalidCodeAnalysisTestTrait; /** * @return iterable,error_levels?:string[]}> diff --git a/tests/TypeAnnotationTest.php b/tests/TypeAnnotationTest.php index fb7ff764d6b..a5bb113e845 100644 --- a/tests/TypeAnnotationTest.php +++ b/tests/TypeAnnotationTest.php @@ -1,10 +1,13 @@ ,error_levels?:string[]}> diff --git a/tests/TypeCombinationTest.php b/tests/TypeCombinationTest.php index 4850c098706..cfb37416a54 100644 --- a/tests/TypeCombinationTest.php +++ b/tests/TypeCombinationTest.php @@ -2,13 +2,14 @@ namespace Psalm\Tests; use Psalm\Internal\Type\TypeCombiner; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use Psalm\Type; use function array_values; class TypeCombinationTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; /** * @dataProvider providerTestValidTypeCombination diff --git a/tests/UnusedCodeTest.php b/tests/UnusedCodeTest.php index 45d173cc069..3df3da209c3 100644 --- a/tests/UnusedCodeTest.php +++ b/tests/UnusedCodeTest.php @@ -9,7 +9,7 @@ use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; use Psalm\IssueBuffer; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use function getcwd; use function preg_quote; @@ -32,7 +32,7 @@ public function setUp() : void new TestConfig(), new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/UnusedVariableTest.php b/tests/UnusedVariableTest.php index 02c30ac12d4..fc133117aec 100644 --- a/tests/UnusedVariableTest.php +++ b/tests/UnusedVariableTest.php @@ -8,7 +8,7 @@ use Psalm\Internal\Provider\FakeFileProvider; use Psalm\Internal\Provider\Providers; use Psalm\Internal\RuntimeCaches; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; use function preg_quote; use function strpos; @@ -30,7 +30,7 @@ public function setUp() : void new TestConfig(), new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); diff --git a/tests/VariadicTest.php b/tests/VariadicTest.php index 568f05e672b..94b9bd325d7 100644 --- a/tests/VariadicTest.php +++ b/tests/VariadicTest.php @@ -8,14 +8,15 @@ use Psalm\Internal\Analyzer\ProjectAnalyzer; use Psalm\Internal\IncludeCollector; use Psalm\Internal\Provider\Providers; -use Psalm\Tests\Internal\Provider; +use Psalm\Tests\Internal\Provider\FakeParserCacheProvider; +use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait; use function dirname; use function getcwd; class VariadicTest extends TestCase { - use Traits\ValidCodeAnalysisTestTrait; + use ValidCodeAnalysisTestTrait; public function testVariadicArrayBadParam(): void { @@ -137,7 +138,7 @@ private function getProjectAnalyzerWithConfig(Config $config): ProjectAnalyzer $config, new Providers( $this->file_provider, - new Provider\FakeParserCacheProvider() + new FakeParserCacheProvider() ) ); $project_analyzer->setPhpVersion('7.3', 'tests');