Commit 97829f9
Include unsealed extras in
`ConstantArrayTypeBuilder::getArray()` in the degrade-to-general-array
branch builds `new ArrayType(union($keyTypes), union($valueTypes))`
from the explicit slots only — the unsealed extras' key/value
contribution was silently dropped.
Union the unsealed key/value into the degraded `ArrayType`'s key and
value unions when the builder carries real extras. Fixes shuffleArray
(and any other call site that round-trips through
`degradeToGeneralArray()`) on unsealed sources, where the unsealed
value type now reaches the final list/array form.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ConstantArrayTypeBuilder degraded-array form1 parent 600b998 commit 97829f9
2 files changed
Lines changed: 32 additions & 1 deletion
File tree
- src/Type/Constant
- tests/PHPStan/Analyser/nsrt
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
476 | 489 | | |
477 | | - | |
| 490 | + | |
478 | 491 | | |
479 | 492 | | |
480 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
499 | 517 | | |
500 | 518 | | |
501 | 519 | | |
| |||
0 commit comments