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
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
45
45
46
46
### Fixed
47
47
48
+
-**Callable parameter type parsing in union types.**`extract_callable_param_types` now handles callable signatures wrapped in unions like `(Closure(Builder<TModel>): mixed)|null`, `callable(Collection<int, TValue>, int): mixed|null`, and `null|callable(Order): bool`. Previously the parser treated the entire union as one token and failed to find the callable signature. The `split_type_token` tokenizer was also fixed to keep generic suffixes like `Collection<int, User>|null` and parenthesized groups like `(Closure(X): Y)|null` as single tokens instead of splitting at the closing `>`, `}`, or `)`. This enables closure parameter inference for Laravel methods like `Builder::whereHas()`, `BuildsQueries::chunk()`, and `Builder::with()`, where the callback parameter types use these union patterns.
48
49
-**Blank lines inside method chains no longer break resolution.** A blank (or whitespace-only) line between segments of a fluent chain (e.g. `Brand::with('english')\n\n ->paginate()`) caused the backward walk in `collapse_continuation_lines` to stop prematurely, treating the empty line as the base expression. Neither completion nor go-to-definition worked in this case. The backward walk now skips blank lines, and the collapsed result omits them, so chains with cosmetic spacing resolve correctly.
49
50
-**Arrow function parameter go-to-definition.** Go-to-definition on a variable used in an arrow function body (e.g. `$o` in `fn(Order $o) => $o->getItems()`) now jumps to the parameter on the same line. Previously the backward scan excluded the cursor line, so it would skip the arrow function parameter and jump to an unrelated earlier variable with the same name. The fix includes the cursor line in the scan but only accepts non-assignment definitions (parameters, foreach, catch, static/global) to preserve the existing behavior for reassignments like `$value = $value->value`. Go-to-definition on the parameter itself (the LHS `$o`) correctly resolves the type hint and jumps to the `Order` class.
50
51
-**Relationship property collection type uses the related model's custom collection.** When a model like `Product` had a `HasMany<Review, $this>` relationship, the virtual property `$product->reviews` incorrectly used the owning model's custom collection (`ProductCollection`) instead of the related model's (`ReviewCollection`). The provider now loads the related model via `class_loader` and reads its `custom_collection` field. The integration test was updated to use distinct collections per model so the bug is no longer masked.
Copy file name to clipboardExpand all lines: docs/todo-laravel.md
-15Lines changed: 0 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,21 +8,6 @@ virtual member provider design, see `ARCHITECTURE.md`.
8
8
9
9
---
10
10
11
-
## Missing features
12
-
13
-
### 2. Closure parameter inference in collection pipelines
14
-
15
-
`$users->map(fn($u) => $u->...)` does not infer `$u` as the
16
-
collection's element type. This is a general generics/callable
17
-
inference problem, not Laravel-specific, but Laravel collection
18
-
pipelines are the most common place users encounter it.
19
-
Other cases:
20
-
- MyModel::whereIn()->chunk(self::CHUNK_SIZE, function (Collection $orders) {})
21
-
- MyModel::whereHas('order', function (Builder $q) {})
22
-
- MyModel::with(['translations' => function (Relation $query) {}]) // translations is the name of the relation on MyModel, Relation will become the return type of that relation
0 commit comments