Skip to content

Commit dc7063f

Browse files
committed
Remove won't fix from Laravel todo
1 parent 613e6cf commit dc7063f

2 files changed

Lines changed: 0 additions & 52 deletions

File tree

docs/todo.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ unlikely to move the needle for most users.
180180
| L9 | Higher-order collection proxies | Low-Medium | Medium-High |
181181
| L10 | `View::withX()` / `RedirectResponse::withX()` dynamic methods | Low | Low |
182182
| L11 | `$appends` array | Low | Low |
183-
| L12 | [`auth()` helper return type](todo/laravel.md#l12-auth-helper-return-type) | Low-Medium | Low |
184-
| L13 | [`app()->make()` container return type](todo/laravel.md#l13-appmake-container-return-type) | Low | Medium |
185183
| | **[External Stubs](todo/external-stubs.md)** | | |
186184
| E2 | Project-level stubs as type resolution source | Medium | Medium |
187185
| E3 | IDE-provided and `.phpantom.toml` stub paths | Low-Medium | Low |

docs/todo/laravel.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -463,53 +463,3 @@ accessors, so in most cases the accessor method itself already produces
463463
the virtual property. Parsing `$appends` would only help when the
464464
accessor 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

Comments
 (0)