diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 414de85..fe10148 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,19 +30,20 @@ jobs: - "--prefer-lowest" steps: - name: Checkout - uses: actions/checkout@v3.5.0 + uses: actions/checkout@v6 - - name: Validate composer.json and composer.lock - run: composer validate - - name: Set up PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + tools: composer:v2 extensions: pcntl, posix coverage: xdebug ini-values: error_reporting=E_ALL + - name: Validate composer.json and composer.lock + run: composer validate + - name: Install dependencies run: composer update --prefer-dist diff --git a/composer.json b/composer.json index 74fbc7d..59ceb65 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "phpunit/phpunit": "^9.6.8", "psalm/plugin-phpunit": "^0.18.4", "squizlabs/php_codesniffer": "^3.7.2", - "vimeo/psalm": "^5.12" + "vimeo/psalm": "^5.17" }, "autoload": { "psr-4": { diff --git a/src/Model/JsonSerializableTrait.php b/src/Model/JsonSerializableTrait.php index 29d0b19..21c86fa 100644 --- a/src/Model/JsonSerializableTrait.php +++ b/src/Model/JsonSerializableTrait.php @@ -30,8 +30,9 @@ trait JsonSerializableTrait */ final public function jsonSerialize(): array { + $thisObjectVars = get_object_vars($this); $includedProperties = array_filter( - get_object_vars($this), + $thisObjectVars, fn (string $key): bool => !in_array($key, $this->excludeFromSerialization(), true), ARRAY_FILTER_USE_KEY, ); diff --git a/test/AllureLifecycleTest.php b/test/AllureLifecycleTest.php index 0c8dd80..740181f 100644 --- a/test/AllureLifecycleTest.php +++ b/test/AllureLifecycleTest.php @@ -875,7 +875,6 @@ public function testWriteContainer_ExcludedContainerWithNestedResults_RemovesNes ->with( self::callback( function (AttachmentResult $attachmentResult) use (&$removeAttachmentResults): bool { - /** @psalm-var list $removeAttachmentResults */ $removeAttachmentResults[] = $attachmentResult; return true; @@ -889,7 +888,6 @@ function (AttachmentResult $attachmentResult) use (&$removeAttachmentResults): b ->with( self::callback( function (TestResult $testResult) use (&$removeTestResults): bool { - /** @psalm-var list $removeTestResults */ $removeTestResults[] = $testResult; return true; @@ -2752,7 +2750,6 @@ public function testWriteTest_ExcludedTestWithNestedResults_RemovesNestedResults ->with( self::callback( function (AttachmentResult $attachmentResult) use (&$removeAttachmentResults): bool { - /** @psalm-var list $removeAttachmentResults */ $removeAttachmentResults[] = $attachmentResult; return true; diff --git a/test/AllureTest.php b/test/AllureTest.php index eddc3d8..9e9a165 100644 --- a/test/AllureTest.php +++ b/test/AllureTest.php @@ -242,7 +242,7 @@ public function testRunStep_OnlyMethodDisplayNameAttributeProvided_StepHasMatchi } #[DisplayName('b')] - public function titledStep(): void + public function titledStep(StepContextInterface $_): void { } @@ -293,7 +293,7 @@ public function testRunStep_MethodParameterAttributeProvided_StepHasMatchingPara } #[Parameter('b', 'c')] - public function parametrizedStep(): void + public function parametrizedStep(StepContextInterface $_): void { }