File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,6 +261,46 @@ Two pieces are needed:
261261 for template substitution, producing a union of the possible return
262262 types.
263263
264+ ### 24. Namespaced class breaks ` static ` return type chain resolution
265+ ** Priority: Medium**
266+
267+ When a class lives in a namespace and calls a static method whose return
268+ type is ` Builder<static> ` , the chain resolution breaks. The same code
269+ works without a namespace.
270+
271+ ``` php
272+ // lead_providers.php
273+ namespace Luxplus\Core\Database\Model\LeadProviders;
274+
275+ final class LeadProviders extends Model {}
276+
277+ LeadProviders::query()-> // ← no completion (works without the namespace)
278+ ```
279+
280+ ``` php
281+ // model.php (same or separate file)
282+ abstract class Model
283+ {
284+ /** @return \Illuminate\Database\Eloquent\Builder */
285+ public static function query() {}
286+ }
287+ ```
288+
289+ ``` php
290+ // builder.php
291+ namespace Illuminate\Database\Eloquent;
292+
293+ class Builder
294+ {
295+ public function where() {}
296+ }
297+ ```
298+
299+ The generic argument in ` Builder ` should resolve to
300+ ` LeadProviders ` , giving a ` Builder ` , and ` where() ` should then be
301+ offered. With a namespace present the chain breaks, likely because the
302+ FQN resolution of ` Model ` when a namespace is involved.
303+
264304---
265305
266306## Go-to-Definition Gaps
You can’t perform that action at this time.
0 commit comments