You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
119
119
120
120
### Fixed
121
121
122
+
-**A fully-qualified type-guard call narrows like its unqualified spelling.**`\is_array($x)`, the style PHP-CS-Fixer's `native_function_invocation` rule enforces, kept the leading backslash in the function name PHPantom compared against `is_array`, `is_string`, and the rest, so the comparison never matched and the guard was silently ignored in both branches. The same held for `\is_a()`, `\class_exists()` and its siblings, and `\property_exists()`/`\method_exists()`. All four narrowing checks now strip a leading backslash before matching, so a project that fully qualifies its builtin calls narrows exactly as one that does not.
122
123
-**Formatting a `.blade.php` file is a no-op.**`textDocument/formatting` handed Blade markup straight to the Pint/php-cs-fixer/phpcbf/mago pipeline with no check on the file's extension, so running "Format Document" on a template sent directives, `{{ }}` echoes, and component tags through a PHP formatter, which most likely errored out or produced nonsense edits. Formatting now returns no edits for a `.blade.php` file (matched the same way completion and hover already recognise Blade, so it also covers a file opened with a `blade` language ID that lacks the extension) until real Blade-aware formatting lands.
123
124
-**An array literal whose keys are out of order no longer passes for a list.**`list{string, string}` and `list<string>` promise the keys run `0, 1, 2, …` in that order, which is what `array_is_list()` answers `true` for, and `[1 => 'x', 0 => 'y']` does not hold. PHPantom accepted it silently: a `list{…}` was read as the `array{…}` it prints as, and a shape's keys were never compared against the order a list requires. The promise is part of the type now, so a parameter written as a list is reported for a literal whose keys are reversed, gapped, or named, and the message says the order is the complaint rather than leaving two near-identical type expressions to be diffed by eye. Hover also spells such a parameter back the way it was written instead of widening it to an `array{…}`. Only a literal written out at the call site is judged, since an array built up across assignments lists the keys we saw in the order we saw them, which says nothing about the order the value's keys are really in.
124
125
- **An indexed collection keeps its element type after a check on it.** `if (!$category->translations[0]) { continue; }` is the ordinary way to make sure a relation's first entry is there before reading it, and the check itself was what lost the type: the entry was recorded under a name built from the whole expression, and that name was then read back as if `translations[0]` were a property the class declared. Nothing declares it, so a model that answers any property name at all answered this one with `mixed`, and because a check's conclusion outranks anything else, every later read of the same expression was judged against that `mixed`. `$category->translations[0]->name` was reported as unverifiable, both inside the guard and everywhere after it, and one guarded expression was enough to spoil the identical unguarded expression further down the file. The index is now read as an index, so the entry keeps the collection's element type, however many property hops it took to reach the collection and whether the guard is written on its own or as one link of a longer `||` chain.
| D17 |[`docblock_native_mismatch` only judges nullability](todo/diagnostics.md#d17-docblock_native_mismatch-only-judges-nullability)| Low | Medium |
99
99
||**[Bug Fixes](todo/bugs.md)**|||
100
+
| B125 |[A class narrowed by `instanceof` keeps an array alternative from before the check](todo/bugs.md#b125-a-class-narrowed-by-instanceof-keeps-an-array-alternative-from-before-the-check)| High | Medium |
100
101
| B124 |[An argument's type is read from its source text, and several ordinary spellings read as nothing](todo/bugs.md#b124-an-arguments-type-is-read-from-its-source-text-and-several-ordinary-spellings-read-as-nothing)| Medium | Medium |
101
102
||**[Code Actions](todo/actions.md)**|||
102
103
| A40 |[Generate method from call](todo/actions.md#a40-generate-method-from-call)| Medium-High | Medium |
0 commit comments