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
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
26
-**Array shape keys with special characters.** Array literal keys containing backslashes, newlines, or other non-identifier characters are now properly quoted and escaped in type display (e.g. `array{'foo\\bar\nbaz': string}` instead of a truncated type string).
27
27
-**Static method calls on class-string unions.**`$variable::method()` where `$variable` holds a union of class-strings now resolves through all possible classes and unions their return types.
28
28
-**Trait `self` return type resolution through inheritance.** When a trait method has return type `self`, calling it on a subclass now correctly resolves to the class that uses the trait (the declaring class), not the calling subclass. `static` and `$this` continue to resolve to the runtime class.
29
-
-**`NoRewindIterator` generic resolution.** Added stub patch so `new NoRewindIterator($generator)` propagates the wrapped iterator's type parameters.
29
+
-**SPL iterator generic type propagation.**`CachingIterator`, `InfiniteIterator`, `LimitIterator`, `NoRewindIterator`, `CallbackFilterIterator`, and `FilterIterator` now propagate the wrapped iterator's generic type parameters. Calling `->current()` or `->key()` on any of these decorators returns the correct element type instead of `mixed`.
30
+
-**`ArrayIterator` constructor generic inference.**`new ArrayIterator($typedArray)` now infers `TKey` and `TValue` from the array argument's generic type, so the resulting iterator preserves key and value types through the chain.
30
31
-**Template param inference from type bounds.** When a class template parameter has a bound like `TIterator as Iterator<TKey, TValue>` and `TIterator` is resolved to a concrete generic type, the nested template params (`TKey`, `TValue`) are now inferred from the concrete type's generic arguments.
31
-
-**`@psalm-param`/`@phpstan-param` priority over `@param`.** When a docblock contained both `@param array $x` and `@psalm-param array<TKey, T> $x`, the parameter type was resolved from whichever tag appeared first in the docblock. Now `@phpstan-param` always takes precedence over `@psalm-param`, which always takes precedence over `@param`, matching PHPStan and Psalm behaviour. This fixes generic constructor inference when stubs use paired `@param`/`@psalm-param` tags.
32
+
-**`@psalm-param`/`@phpstan-param` priority over `@param`.** When a docblock contained both `@param array $x` and `@psalm-param array<TKey, T> $x`, the parameter type was resolved from whichever tag appeared first in the docblock. Now `@phpstan-param` always takes precedence over `@psalm-param`, which always takes precedence over `@param`, matching PHPStan and Psalm behaviour.
32
33
-**`static` return type through first-class callables.**`self::method(...)()`, `static::method(...)()`, `parent::method(...)()`, and `$this->method(...)()` now preserve `static` in the return type when the underlying method declares `@return static`.
33
34
-**ArrayAccess array-access assignment.**`$obj[$key] = $val` on objects implementing `ArrayAccess` no longer overwrites the variable's generic type annotation with an array type.
34
35
-**Method-level `@template` with `key-of` bound.** When a method declares `@template K as key-of<TData>` and returns `TData[K]`, passing a string literal argument (e.g. `$config->get('name')`) now infers K from the literal and resolves the return type to the specific array shape value type.
0 commit comments