From 1ad9fc66f8d3f332a398d6d23cf3d0f91a604f79 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 25 Jul 2023 10:09:29 +0200 Subject: [PATCH] Fixes --- .github/workflows/windows-ci.yml | 2 +- composer.json | 2 +- src/Psalm/Internal/Codebase/ClassLikes.php | 10 ++++++---- tests/TypeReconciliation/ReconcilerTest.php | 2 ++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 5b6a06c4e..f8415667b 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -96,4 +96,4 @@ jobs: run: php bin/generate_testsuites.php $env:CHUNK_COUNT - name: Run unit tests - run: vendor/bin/paratest --processes=$env:PARALLEL_PROCESSES --testsuite=chunk_$env:CHUNK_NUMBER --log-junit build/phpunit/phpunit.xml + run: vendor/bin/paratest -f --processes=$env:PARALLEL_PROCESSES --testsuite=chunk_$env:CHUNK_NUMBER --log-junit build/phpunit/phpunit.xml diff --git a/composer.json b/composer.json index 7f4a9f9c8..f9b774b8a 100644 --- a/composer.json +++ b/composer.json @@ -112,7 +112,7 @@ "lint": "parallel-lint ./src ./tests", "phpunit": [ "Composer\\Config::disableProcessTimeout", - "paratest --runner=WrapperRunner" + "paratest -f --runner=WrapperRunner" ], "phpunit-std": [ "Composer\\Config::disableProcessTimeout", diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index b54e09b18..fa92b057d 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -367,6 +367,8 @@ class ClassLikes && !$this->classlike_storage_provider->has($fq_class_name_lc) ) { if (!isset($this->existing_classes_lc[$fq_class_name_lc])) { + $this->existing_classes_lc[$fq_class_name_lc] = false; + return false; } @@ -399,8 +401,8 @@ class ClassLikes || !$this->classlike_storage_provider->has($fq_class_name_lc) ) { if (( - !isset($this->existing_classes_lc[$fq_class_name_lc]) - || $this->existing_classes_lc[$fq_class_name_lc] + !isset($this->existing_interfaces_lc[$fq_class_name_lc]) + || $this->existing_interfaces_lc[$fq_class_name_lc] ) && !$this->classlike_storage_provider->has($fq_class_name_lc) ) { @@ -466,8 +468,8 @@ class ClassLikes || !$this->classlike_storage_provider->has($fq_class_name_lc) ) { if (( - !isset($this->existing_classes_lc[$fq_class_name_lc]) - || $this->existing_classes_lc[$fq_class_name_lc] + !isset($this->existing_enums_lc[$fq_class_name_lc]) + || $this->existing_enums_lc[$fq_class_name_lc] ) && !$this->classlike_storage_provider->has($fq_class_name_lc) ) { diff --git a/tests/TypeReconciliation/ReconcilerTest.php b/tests/TypeReconciliation/ReconcilerTest.php index a3b722ff3..10ca3b22e 100644 --- a/tests/TypeReconciliation/ReconcilerTest.php +++ b/tests/TypeReconciliation/ReconcilerTest.php @@ -2,6 +2,7 @@ namespace Psalm\Tests\TypeReconciliation; +use Countable; use Psalm\Context; use Psalm\Internal\Analyzer\FileAnalyzer; use Psalm\Internal\Analyzer\StatementsAnalyzer; @@ -61,6 +62,7 @@ class ReconcilerTest extends TestCase class B {} interface SomeInterface {} '); + $this->project_analyzer->getCodebase()->queueClassLikeForScanning(Countable::class); $this->project_analyzer->getCodebase()->scanFiles(); }