Commit caa4ac8
authored
fix(tests): re-narrow $GLOBALS['TCA'] for PHPStan 2.2.6 (#526)
## Problem
CI on `main` is red on all PHPStan matrix cells:
```
Tests/Functional/Service/Tool/GetFlexFormSchemaToolTest.php:57
Cannot access offset 'tx_demo_flex' on mixed.
```
PHPStan 2.2.6 (released 2026-07-26, picked up because the extension does
not commit `composer.lock`) no longer carries the
`self::assertIsArray($GLOBALS['TCA'])` narrowing across the intervening
`$singleDs` statement, so `$GLOBALS['TCA']` is `mixed` again by line 57
and the offset write fails.
## Fix
Re-narrow with a native `\assert(is_array($GLOBALS['TCA']))` directly
before the write — the project convention for array narrowing (see
`Tests/CLAUDE.md`).
## Verification
`./Build/Scripts/runTests.sh -s phpstan` locally (PHP 8.5): `[OK] No
errors`.1 file changed
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
0 commit comments