-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Adjustment] Inject adjustment types that shall be cleared #9308
Conversation
Can't see any BC breaks, where are they? |
My bad, they've just vanished magically 😄 ⭐️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, one possible BC break here: if there are no arguments passed (new OrderAdjustmentsClearer()
), we should use the default values.
IIRC we can get this info by calling
We also need to trigger user deprecation error there, just as Symfony does it:
|
@@ -26,6 +26,18 @@ | |||
|
|||
public function __construct(array $adjustmentsToRemove = []) | |||
{ | |||
if (0 === func_num_args()) { | |||
@trigger_error('Adjustment types should be passed explicitly', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also might want to mention that not passing them is deprecated since 1.2 and will be prohibited by 2.0
dec7ed2
to
e7f020e
Compare
Yay, first deprecation in Sylius, thank you Mateusz! 🥇 |
I'm very happy I could provide that, I hope we will be able to have as many deprecations as possible xD |
Due to the fact, that cleared adjustments types has been set as static array, after adding new adjustment type (that is also processed during checkout), it was necessary to implement whole new class (with very similar/the same implementation, but different static array) and override the service definition. With this change, only definition overriding is needed.