Skip to content

Commit 59325dc

Browse files
committed
Fix the nonempty template fixture used by CI
Return the fixture input so its implementation satisfies the nonempty return type inferred from its template bound. Document clearing the PHPStan result cache before verification. Cached results had hidden the return-type error in the unchanged fixture during local checks.
1 parent a0ece4d commit 59325dc

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

docs/development/behavior-contract.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ does not mandate one internal type representation for those combinations.
5858
```sh
5959
composer phpunit -- --no-coverage --filter 'ArrayMergeContractTest|ArrayMergeNativeBehaviorTest'
6060
composer phpunit -- --no-coverage
61+
composer phpstan -- clear-result-cache
6162
composer phpstan -- analyze --no-progress
6263
composer phpcs
6364
```
6465

6566
Use PHPUnit's `--filter` with a dataset name to replay one combination. CI also
6667
runs these tests in the existing PHPStan compatibility jobs.
6768

69+
Clear PHPStan's result cache when checking changes to the extension. Cached
70+
results can hide new diagnostics in fixtures whose source has not changed.
71+
6872
When a test fails, check fixture validity and the independent expected behavior
6973
before changing either production code or an assertion. Keep a minimal named
7074
case for a demonstrated defect. Do not replace expectations with the current

tests/fixtures/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function nested(array $a, array $b, array $c): array
7979
*/
8080
function genericMergeUnionOperand(array $value): array
8181
{
82-
return [];
82+
return $value;
8383
}
8484

8585
/**

0 commit comments

Comments
 (0)