Skip to content

Mark deprecated features for v2.0 removal with deprecation warnings#75

Open
peterfox wants to merge 3 commits into
mainfrom
claude/optimistic-curie-dJgm4
Open

Mark deprecated features for v2.0 removal with deprecation warnings#75
peterfox wants to merge 3 commits into
mainfrom
claude/optimistic-curie-dJgm4

Conversation

@peterfox
Copy link
Copy Markdown
Collaborator

@peterfox peterfox commented Jun 2, 2026

Summary

This PR adds deprecation notices to several features that will be removed in v2.0, guiding users toward the recommended upgrade path. Each deprecated component now includes both PHPDoc annotations and runtime deprecation warnings via trigger_error().

Key Changes

  • SubscribableApplicationServiceProvider: Added deprecation notice directing users to publish the subscriber-provider stub and configure callbacks directly in their service provider's boot() method
  • SubscriberMailChannel: Added deprecation notice recommending explicit opt-in via SubscribableMailMessage::via() instead of automatic unsubscribe-link injection
  • Subscriber::userModel(): Added deprecation notice directing users to remove calls and use polymorphic model resolution via morph maps instead
  • CheckNotifiableSubscriptionStatus interface: Added deprecation notice indicating subscription gating is now handled by SubscribableMailMessage::via()
  • CheckSubscriptionStatusBeforeSendingNotifications interface: Added deprecation notice indicating subscription gating is now handled by SubscribableMailMessage::via()

Implementation Details

  • All deprecation warnings use E_USER_DEPRECATED to allow users to control handling via error reporting configuration
  • Each deprecated component includes a reference to UPGRADE.md for detailed migration guidance
  • Runtime warnings are triggered at the point of use (method calls or class instantiation) to ensure users are notified during development
  • PHPDoc annotations provide IDE support and static analysis hints about deprecation status

https://claude.ai/code/session_01MsY3G5SB16WXTcZGkMb7FX

claude added 3 commits May 31, 2026 10:54
Mark the five APIs removed in v2.0 with @deprecated docblocks and
E_USER_DEPRECATED trigger_error() calls so users upgrading from 1.x
receive runtime and static-analysis notice of what needs to change:

- SubscribableApplicationServiceProvider — replaced by a published plain stub
- Subscriber::userModel() — replaced by polymorphic URL-based model resolution
- SubscriberMailChannel — replaced by SubscribableMailMessage::via() explicit opt-in
- CheckSubscriptionStatusBeforeSendingNotifications — tied to SubscriberMailChannel
- CheckNotifiableSubscriptionStatus — tied to SubscriberMailChannel

Each deprecation message links to the relevant section of UPGRADE.md.
…ecation

SubscribableServiceProvider references SubscriberMailChannel::class to bind
it in the container. The class is intentionally deprecated for v2.0, so the
resulting phpstan-deprecation-rules error is expected and should be silenced
via the baseline rather than removed.
- Add @deprecated inline tag to the Subscriber facade's userModel() @method
  docblock so IDEs surface the deprecation when called via the facade
- Add deprecation comment to the SubscribableServiceProvider stub so users
  who publish it get an immediate hint to migrate to the v2 plain-stub approach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants