Conversation
There was a problem hiding this comment.
Pull request overview
This PR deprecates existing subscription methods and introduces new recommended static methods for connecting and disconnecting subscriptions, promoting better API design with static factory methods in the Metrics namespace.
Key Changes:
- Deprecated
Subscription::all(),connect(), anddisconnect()instance methods - Added new static
connect()anddisconnect()methods toMetrics\Customers\Subscription - Updated documentation to reflect recommended usage patterns
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Subscription.php | Deprecated all(), connect(), and disconnect() methods with appropriate warnings |
| src/Metrics/Customers/Subscription.php | Added new static connect() and disconnect() methods as replacements |
| README.md | Updated documentation to show recommended vs deprecated usage patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
525aea3 to
d156e68
Compare
swember
approved these changes
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deprecated Methods:
Subscription::all()- triggersE_USER_DEPRECATEDwarningSubscription::connect()- triggersE_USER_DEPRECATEDwarningSubscription::disconnect()- triggersE_USER_DEPRECATEDwarningNew Methods in
ChartMogul\Metrics\Customers\Subscription:connect($dataSourceUUID, $customerUUID, array $subscriptions)- accepts onlyMetrics\Customers\Subscriptioninstancesdisconnect($dataSourceUUID, $customerUUID, array $subscriptions)- accepts onlyMetrics\Customers\Subscriptioninstances