|
2 | 2 |
|
3 | 3 | All breaking changes prior to v1 will be documented in this file to assist with upgrading. |
4 | 4 |
|
| 5 | +## v1.0.0 |
| 6 | + |
| 7 | +Upgrading to this version introduces 4 changes that may require action |
| 8 | + |
| 9 | +1. Migrated away from native enums to reduce the risk of breaking changes |
| 10 | + |
| 11 | +If your implementation utilises any of the Enums defined in the Paddle SDK you will have to update their usage. |
| 12 | + |
| 13 | +For example: |
| 14 | + `Status::Active` => `Status::Active()` |
| 15 | + `$status === Status::Active` => `$status->equals(Status::Active())` |
| 16 | + |
| 17 | +2. Made entities consistent with `array<Entity>` usage where Collections were used instead |
| 18 | + |
| 19 | +There was some inconsistent typing for Entities that had properties consisting of a collection of another Entity. These fields |
| 20 | +shouldn't impact usage of those properties but if you relied on any of the following types you will face breakages. |
| 21 | + |
| 22 | + - `\Paddle\SDK\Entities\NotificationSetting` field `subscribedEvents` was `EventTypeCollection` and is now `array<EventType>` |
| 23 | + - `\Paddle\SDK\Entities\Product` field `prices` was `PriceCollection` and is now `array<Price>` |
| 24 | + |
| 25 | +3. Subscription item `price` re-uses the `Price` entity |
| 26 | + |
| 27 | +The `\Paddle\SDK\Entities\Subscription\SubscriptionItem` `price` field type has changed to the main entity `\Paddle\SDK\Entities\Price`. |
| 28 | + |
| 29 | +Any previous type hints for `\Paddle\SDK\Entities\Subscription\SubscriptionPrice` should be updated accordingly. |
| 30 | + |
| 31 | +4. Dropped `@internal` on most entities to prevent IDE warnings, utilising private constructors instead |
| 32 | + |
| 33 | +In the last major update we made change we introduced `@internal` doc blocks for entities which were hydrated from API responses. |
| 34 | + |
| 35 | +We noticed these started to highlight properties using constructor property promotion being highlighted as internal which wasn't the intention. |
| 36 | + |
| 37 | +We've dropped the `@internal` doc block and been stricter with private constructors. If you had relied on instantiating these entities directly |
| 38 | +you may face breakages. This was not intentionally part of the public API for the package and thus has been restricted moving forward. |
| 39 | + |
5 | 40 | ## v0.3.0 |
6 | 41 |
|
7 | 42 | This version introduces several breaking changes. |
@@ -55,7 +90,7 @@ Any typing of the following classes should be updated accordingly: |
55 | 90 |
|
56 | 91 | The type has changed when creating an Adjustment using the `CreateAdjustment` operation. To create an Adjustment you must now use the `\Paddle\SDK\Resources\Adjustments\Operations\Create\AdjustmentItem` instance for `items`. |
57 | 92 |
|
58 | | -- Core entities (classes implementing `Entity`) are marked @internal and constructors are `protected` |
| 93 | +- Core entities (classes implementing `Entity`) are marked `@internal` and constructors are `protected` |
59 | 94 |
|
60 | 95 | Any direct usage of these classes is not supported functionality by the SDK and has been removed to reduce the surface area for breaking changes. |
61 | 96 |
|
|
0 commit comments