diff --git a/.circleci/config.yml b/.circleci/config.yml index 08c1a0d66aa..fb7edfe00e2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ jobs: - run: name: Code Style Analysis with PHPCS - command: vendor/bin/phpcs + command: vendor/bin/phpcs -d memory_limit=512M phar-build: executor: php-74 diff --git a/src/Psalm/Internal/Algebra.php b/src/Psalm/Internal/Algebra.php index 3574841eaa0..d2b16a26c0f 100644 --- a/src/Psalm/Internal/Algebra.php +++ b/src/Psalm/Internal/Algebra.php @@ -326,6 +326,7 @@ public static function simplifyCNF(array $clauses): array * Look for clauses with only one possible value * * doesn't infer the "unset" correctly + * * @psalm-suppress MoreSpecificReturnType * @param list $clauses * @param array $cond_referenced_var_ids diff --git a/src/Psalm/Internal/Fork/Pool.php b/src/Psalm/Internal/Fork/Pool.php index 1d097b19123..09e525dde6d 100644 --- a/src/Psalm/Internal/Fork/Pool.php +++ b/src/Psalm/Internal/Fork/Pool.php @@ -98,6 +98,7 @@ class Pool * @param array> $process_task_data_iterator * An array of task data items to be divided up among the * workers. The size of this is the number of forked processes. + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint * @param Closure $startup_closure * A closure to execute upon starting a child * @param Closure(int, mixed):mixed $task_closure diff --git a/src/Psalm/Internal/Provider/FileReferenceCacheProvider.php b/src/Psalm/Internal/Provider/FileReferenceCacheProvider.php index 9f469a08ed2..fde0770246c 100644 --- a/src/Psalm/Internal/Provider/FileReferenceCacheProvider.php +++ b/src/Psalm/Internal/Provider/FileReferenceCacheProvider.php @@ -23,10 +23,10 @@ use const LOCK_EX; /** - * @psalm-import-type FileMapType from Analyzer - * * Used to determine which files reference other files, necessary for using the --diff * option from the command line. + * + * @psalm-import-type FileMapType from Analyzer * @internal */ class FileReferenceCacheProvider diff --git a/src/Psalm/Internal/Provider/FileReferenceProvider.php b/src/Psalm/Internal/Provider/FileReferenceProvider.php index 459447bbb94..a1e1f2529b4 100644 --- a/src/Psalm/Internal/Provider/FileReferenceProvider.php +++ b/src/Psalm/Internal/Provider/FileReferenceProvider.php @@ -17,10 +17,10 @@ use function file_exists; /** - * @psalm-import-type FileMapType from Analyzer - * * Used to determine which files reference other files, necessary for using the --diff * option from the command line. + * + * @psalm-import-type FileMapType from Analyzer * @internal */ class FileReferenceProvider diff --git a/src/Psalm/Type/Atomic/TCallableList.php b/src/Psalm/Type/Atomic/TCallableList.php index 8ff15012028..764f1ca2c4d 100644 --- a/src/Psalm/Type/Atomic/TCallableList.php +++ b/src/Psalm/Type/Atomic/TCallableList.php @@ -7,9 +7,9 @@ use function array_fill; /** - * @deprecated Will be removed in Psalm v6, please use TCallableKeyedArrays with is_list=true instead. - * * Denotes a list that is _also_ `callable`. + * + * @deprecated Will be removed in Psalm v6, please use TCallableKeyedArrays with is_list=true instead. * @psalm-immutable */ final class TCallableList extends TNonEmptyList diff --git a/src/Psalm/Type/Atomic/TDependentListKey.php b/src/Psalm/Type/Atomic/TDependentListKey.php index 042c95d4d5a..338136d84d9 100644 --- a/src/Psalm/Type/Atomic/TDependentListKey.php +++ b/src/Psalm/Type/Atomic/TDependentListKey.php @@ -3,9 +3,9 @@ namespace Psalm\Type\Atomic; /** - * @deprecated Will be removed in Psalm v6, use TIntRange instead - * * Represents a list key created from foreach ($list as $key => $value) + * + * @deprecated Will be removed in Psalm v6, use TIntRange instead * @psalm-immutable */ final class TDependentListKey extends TInt implements DependentType diff --git a/src/Psalm/Type/Atomic/TList.php b/src/Psalm/Type/Atomic/TList.php index 9e2c611c3a4..13c44e5b453 100644 --- a/src/Psalm/Type/Atomic/TList.php +++ b/src/Psalm/Type/Atomic/TList.php @@ -14,16 +14,15 @@ use function get_class; /** - * @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead. - * * You may also use the \Psalm\Type::getListAtomic shortcut, which creates unsealed list-like shaped arrays * with all elements optional, semantically equivalent to a TList. * - * * Represents an array that has some particularities: * - its keys are integers * - they start at 0 * - they are consecutive and go upwards (no negative int) + * + * @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead. * @psalm-immutable */ class TList extends Atomic diff --git a/src/Psalm/Type/Atomic/TNonEmptyList.php b/src/Psalm/Type/Atomic/TNonEmptyList.php index e6c02940d99..47c628ccd7e 100644 --- a/src/Psalm/Type/Atomic/TNonEmptyList.php +++ b/src/Psalm/Type/Atomic/TNonEmptyList.php @@ -8,13 +8,12 @@ use function array_fill; /** - * @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead. - * * You may also use the \Psalm\Type::getNonEmptyListAtomic shortcut, which creates unsealed list-like shaped arrays * with one non-optional element, semantically equivalent to a TNonEmptyList. * - * * Represents a non-empty list + * + * @deprecated Will be removed in Psalm v6, please use TKeyedArrays with is_list=true instead. * @psalm-immutable */ class TNonEmptyList extends TList diff --git a/tests/EndToEnd/SuicidalAutoloaderTest.php b/tests/EndToEnd/SuicidalAutoloaderTest.php index 0da71a9187e..0aaf3b51154 100644 --- a/tests/EndToEnd/SuicidalAutoloaderTest.php +++ b/tests/EndToEnd/SuicidalAutoloaderTest.php @@ -18,6 +18,6 @@ public function testSucceedsWithEmptyFile(): void $this->markTestSkipped('Test case requires PHP 7.2.'); } - $this->runPsalm(['--no-cache'], __DIR__ . '/' . '../fixtures/SuicidalAutoloader/'); + $this->runPsalm(['--no-cache'], __DIR__ . '/' . '../fixtures/SuicidalAutoloader'); } } diff --git a/tests/Template/FunctionClassStringTemplateTest.php b/tests/Template/FunctionClassStringTemplateTest.php index d3dfbabda97..d4166943f8b 100644 --- a/tests/Template/FunctionClassStringTemplateTest.php +++ b/tests/Template/FunctionClassStringTemplateTest.php @@ -407,7 +407,7 @@ public function checkExpectations() : void * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ - function mock(string $className) + function mockHelper(string $className) { eval(\'"there be dragons"\'); @@ -424,10 +424,10 @@ public function foo() : void {} */ function useMockTemplated(string $className) : void { - mock($className)->checkExpectations(); + mockHelper($className)->checkExpectations(); } - mock(A::class)->foo();', + mockHelper(A::class)->foo();', ], 'allowTemplatedIntersectionFirstTemplatedMock' => [ 'code' => 'checkExpectations(); + mockHelper($className)->checkExpectations(); } - mock(A::class)->foo();', + mockHelper(A::class)->foo();', ], 'allowTemplatedIntersectionSecond' => [ 'code' => 'checkExpectations(); + mockHelper($className)->checkExpectations(); } /** @@ -507,10 +507,10 @@ function useMock(string $className) : void { */ function useMockTemplated(string $className) : void { - mock($className)->checkExpectations(); + mockHelper($className)->checkExpectations(); } - mock(A::class)->foo();', + mockHelper(A::class)->foo();', ], 'returnClassString' => [ 'code' => '