-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
Proposal: Add priorities feature to handlers #645
Conversation
Any feedback dear maintainers? 😉 |
Hi, this will be definitively added, in this days im busy with the 2.0 release on the serializer, give me some time but will be done! |
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.
First of all thanks for the PR and apologies if the review took to long.
I have only one change to request as expressed in the comment.
If you remove the special case for the jms priority, a lot of this pr can be simplified, no need for custom autoloader entry, the fixture can stay in the normal test namespace and so on.
Great contribution, thanks!
foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $attributes) { | ||
$definition = $container->getDefinition($serviceId); | ||
|
||
if (!isset($attributes[0]['priority'])) { |
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.
prefer to keep this simpler without special cases. if the priority is not set, just set it to 0
. users can still control priorities by adding their services by using negative priorities
I did the changes by my self in 7bf1ea3 Thanks for the contribution! |
Thanks @goetas! I am really happy to see that landed :-) |
As a response to #642, #641 and #466 I prepared a proposal of change/feature in this regard, which should improve DX and let developers avoid confusion or similar problems in future.
What these changes introduce:
jms_serializer.handler
andjms_serializer.subscribing_handler
tags a priority attributeCustomHandlersPass
is loading handlers respecting order based on priorities100
(ones fromJMS\Serializer
namespace)0
(will override standard ones by default)