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
refactor: modernise package for PHP 8.4 — final classes, readonly, typed properties
final:
- Subscriber, SubscribableServiceProvider, FakeSubscriber
- UnsubscribeController, LegacyUnsubscribeController
- UserUnsubscribed, UserUnsubscribing
SubscribableMailMessage and the SubscribableNotification trait are left
open — the composable design depends on subclassing.
readonly / constructor property promotion:
- Events use public readonly constructor promotion; $user type corrected
from the misleading Illuminate\Foundation\Auth\User to object
- UnsubscribeController and LegacyUnsubscribeController use private readonly
- Subscriber promotes $app to private readonly
Typed callable properties:
- Subscriber's five handler properties are now private \Closure|null
- parseHandler() returns \Closure via \Closure::fromCallable(), using
Str::parseCallback()'s second argument for the default method name
- Invocation uses first-class callable style: ($this->onFoo)($args)
Other cleanup:
- $hander typo corrected to $handler throughout
- Missing return types added (routeName, checkSubscriptionStatus, etc.)
- Protected visibility on Subscriber/FakeSubscriber internals tightened
to private (no subclassing possible on final classes)
- Redundant @param/@return docblocks removed where signatures suffice
- SubscribableServiceProvider::register() simplified to a short closure
- FakeSubscriber gains assertCheckedSubscriptionStatus() so tests that
previously used Subscriber::shouldReceive() (incompatible with final)
can still verify argument routing via the fake
https://claude.ai/code/session_01R4pAjWwGY8xKspsdU8xnsy
0 commit comments