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
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,13 +40,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
40
40
-**Fix prefixed class name code action.** When PHPStan reports `class.prefixed` (a class name with a vendor prefix like `_PHPStan_`, `RectorPrefix`, or `_PhpScoper`), a quickfix replaces the prefixed name with the corrected one. The diagnostic is eagerly cleared after applying the fix.
41
41
-**Remove always-true `assert()` code action.** When PHPStan reports `function.alreadyNarrowedType` for a call to `assert()` that will always evaluate to true, a quickfix offers to delete the no-op statement. Only `assert()` calls are matched — other functions sharing the same identifier (e.g. `is_string()` inside conditions) are excluded because removal would change control flow. The diagnostic is eagerly cleared once `assert(` no longer appears on the line.
42
42
-**Fix void return mismatch code actions.** When PHPStan reports `return.void` (a void function returns an expression), a quickfix strips the expression to produce a bare `return;`. When PHPStan reports `return.empty` (a non-void function has a bare `return;`), a quickfix changes the native return type to `void` and removes any `@return` docblock tag. The two actions chain naturally: fixing `return.void` may trigger `return.empty`, which then fixes the signature.
43
+
-**Add iterable return type code action.** When PHPStan reports `missingType.iterableValue` for a return type (e.g. "return type has no value type specified in iterable type array"), a quickfix adds a `@return` docblock tag with the element type inferred from the function body. For example, a function returning `$array = ['hello']` produces `@return array<string>` rather than `array<mixed>`. Falls back to `<mixed>` only when the element type cannot be determined. Existing docblocks are updated in place; single-line docblocks are expanded to multi-line. The diagnostic is eagerly cleared once the `@return` tag contains a generic type.
43
44
-**Remove unreachable statement code action.** When PHPStan reports `deadCode.unreachable`, a quickfix deletes the dead statement. The statement-removal helper is shared infrastructure that a future native dead-code diagnostic (D6) can reuse.
44
45
-**Eloquent `$appends` array.** Entries in a model's `$appends` property now produce virtual properties, matching the existing treatment of `$fillable`, `$guarded`, `$hidden`, and `$visible`.
45
46
46
47
### Changed
47
48
48
49
-**`@phpstan-ignore` is never the preferred quickfix.** The "Ignore PHPStan error" code action now explicitly sets `is_preferred: false`. Previously it used `None`, which some editors treated as absent, causing the suppress-with-comment action to be applied on the keyboard shortcut (e.g. Ctrl+. then Enter) when no other quickfix set `is_preferred`.
49
50
51
+
-**Generate PHPDoc infers `@return` from the function body.** Typing `/**` above a function that returns `array` now produces `@return list<string>` (or whatever the body actually returns) instead of the previous `@return array<mixed>`. The same return-statement scanning used by the `missingType.return` and `missingType.iterableValue` code actions is now shared with docblock generation.
52
+
50
53
-**Faster startup.** Stub loading during initialization is significantly faster.
51
54
-**More accurate type operations.** Type substitution during generic resolution (e.g. `Collection<int, User>` inheriting from `Collection<TKey, TValue>`) now operates on the structured type tree instead of string manipulation, improving correctness for complex nested types.
52
55
-**Faster type resolution.** The central type resolution pipeline now operates on structured types directly instead of converting to strings and re-parsing at each step. Union and intersection members, array shape lookups, and generic argument extraction all avoid redundant parsing.
| H17 |[`missingType.iterableValue` — add `@return` with inferred element type](todo/phpstan-actions.md#h17-missingtype-iterablevalue-return-type--add-return-with-iterable-type)| Medium | High |
27
-
| H10 |[`return.unusedType` — remove unused type from return union](todo/phpstan-actions.md#h10-returnunusedtype--remove-unused-type-from-return-union)| Medium | Medium |
28
-
| H6 |`return.type` — update return type to match actual returns | Medium | Medium |
| H10 |[`return.unusedType` — remove unused type from return union](todo/phpstan-actions.md#h10-returnunusedtype--remove-unused-type-from-return-union)| Medium | Medium |
27
+
| H6 |`return.type` — update return type to match actual returns | Medium | Medium |
28
+
||**Release 0.7.0**|||
30
29
31
30
## Sprint 5 — Polish for office adoption
32
31
@@ -122,7 +121,6 @@ unlikely to move the needle for most users.
122
121
| H13 |`property.notFound` — declare missing property (same-class) | Medium | Medium |
123
122
| H15 | Template bound from tip — add `@template T of X`| Medium | Medium |
124
123
| H16 |`match.unhandled` — add missing match arms | Medium | Medium |
125
-
| H17 |`missingType.iterableValue` — add `@return` with inferred element type | Medium | High |
0 commit comments