@@ -463,53 +463,3 @@ accessors, so in most cases the accessor method itself already produces
463463the virtual property. Parsing ` $appends ` would only help when the
464464accessor is defined in an unloaded parent class.
465465
466- #### L12. ` auth() ` helper return type
467-
468- ** Impact: Low-Medium · Effort: Low**
469-
470- ** Status: Needs investigation.**
471-
472- The ` auth() ` helper returns ` Illuminate\Contracts\Auth\Factory ` (the
473- contract interface). Most code immediately calls ` ->user() ` , which is
474- defined on ` Illuminate\Contracts\Auth\Guard ` , not on ` Factory ` . This
475- produces "Method 'user' not found on class 'Factory'" diagnostics.
476-
477- ** Observed:** 2 diagnostics in ` shared ` (in ` GetMarketTrait ` and
478- another file).
479-
480- ** Before implementing, investigate how Larastan handles this.** It may
481- be probing the application at runtime (booting the container to
482- discover which guard is configured) rather than using a static rule.
483- If so, this is borderline for our no-boot philosophy. Also check
484- whether the auth user model type comes from ` config/auth.php ` , which
485- we can't access from a library package like ` shared ` .
486-
487- The idiomatic fix for library code is to avoid ` auth()->user() ` and
488- instead accept the user type as a parameter or call a project-specific
489- ` getCustomer() ` method. These diagnostics may be nudging developers
490- toward better patterns rather than exposing a PHPantom gap.
491-
492- #### L13. ` app()->make() ` container return type
493-
494- ** Impact: Low · Effort: Medium**
495-
496- ** Status: Needs investigation.**
497-
498- ` app()->make(Foo::class) ` returns ` Foo ` at runtime, but PHPantom
499- resolves the return type of ` make() ` from the ` Application ` contract,
500- which declares ` make(string $abstract): mixed ` . This produces
501- "Method 'X' not found on class 'Application'" when the resolved
502- ` mixed ` type is used in a chain.
503-
504- ** Observed:** 1 diagnostic in ` shared ` where
505- ` app()->make(PCNService::class)->getPurchaseOrderDetails() ` fails
506- because ` make() ` returns ` mixed ` .
507-
508- ** Before implementing, investigate how Larastan handles this.** It may
509- be using a ` DynamicReturnTypeExtension ` that resolves ` make($class) `
510- to the concrete type, or it may be doing something that requires
511- container bindings at runtime. If the latter, this falls under "out of
512- scope" per our philosophy. The ` class-string ` argument form
513- (` make(Foo::class) ` returning ` Foo ` ) could be handled statically, but
514- confirm Larastan's actual approach first.
515-
0 commit comments