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
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
22
22
-**Fix unsafe `new static()` code action.** When PHPStan reports `new.static`, three quickfixes are offered: add `@phpstan-consistent-constructor` to the class docblock (preferred), add `final` to the class, or add `final` to the constructor. The diagnostic is eagerly cleared after applying any of the fixes.
23
23
-**Keyword completions.** Context-aware PHP keyword suggestions in statement positions. Keywords are filtered by scope: `return` and `yield` only inside functions, `break` only inside loops and `switch`, `continue` only inside loops, `case` and `default` only inside `switch`, `namespace` only at the top level, and `extends`/`implements` only in declaration headers. Class-like bodies restrict completions to member keywords (`public`, `function`, `const`, etc.) appropriate for the specific kind (class, interface, trait, or enum). Enum backing types (`int`, `string`) are suggested after `enum Name:`. Modifier chains (`public static `) trigger member-keyword completions. Contributed by @ryangjchandler in https://github.com/AJenbo/phpantom_lsp/pull/43.
24
24
-**Attribute completion.** Typing inside `#[…]` now only offers classes decorated with `#[\Attribute]`, filtered by the target of the declaration the attribute applies to. An attribute targeting only methods will not appear when writing `#[…]` above a class, and vice versa. Multi-attribute lists (`#[A, B]`) and namespace-qualified prefixes are supported.
25
+
-**Type-guard narrowing.**`is_array()`, `is_string()`, `is_int()`, `is_float()`, `is_bool()`, `is_object()`, `is_numeric()`, and `is_callable()` now narrow union types inside `if` bodies, `else` bodies, `elseif` bodies, and after guard clauses. When a parameter has a PHPDoc union like `null|list<Request>|Request` with a native hint `null|array|Request`, `is_array()` narrows to `list<Request>`, preserving the generic element type so that `foreach` iteration resolves correctly.
25
26
-**Deferred code action computation.** Code actions now use the two-phase `codeAction/resolve` model. The lightbulb menu appears instantly because expensive edit computation (extract function, inline variable, etc.) is deferred until the user actually picks an action. PHPStan quickfixes clear their diagnostic immediately when applied instead of relying on heuristic content scanning on every keystroke.
26
27
-**Extract function/method.** Select one or more complete statements inside a function or method body and extract them into a new function or private method (`refactor.extract`). Multiple return values use array destructuring. Type hints are inferred automatically. Early returns within the selection are supported, including guard clauses.
27
28
-**Extract variable.** Select an expression and extract it into a new local variable assigned just before the enclosing statement (`refactor.extract`). Smart name generation from method calls (`getName()` → `$name`), property access (`->email` → `$email`), and function calls.
| B7 |[PHPDoc `@param` generic array type not merged with native `array` hint](todo/bugs.md#b7-phpdoc-param-generic-array-type-not-merged-with-native-array-hint)| Low | Medium |
27
26
| H10 |[`return.unusedType` — remove unused type from return union](todo/phpstan-actions.md#h10-returnunusedtype--remove-unused-type-from-return-union)| Medium | Medium |
28
27
| H6 |`return.type` — update return type to match actual returns | Medium | Medium |
0 commit comments