You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if the getSubscribingMethods method of the SubscribingHandlerInterface needs to be static ?
IMO, this is limiting, as we could not access to the handler instance properties.
Accessing it might be useful in order to configure the supported formats and types from a service container definition.
e.g: I've got a basic Enum class. This Enum class is extended from 3 other classes, doing the same things, but defining different constants. The serializer must do the exact same work for those classes. So in order to do that, I'd like to do such a thing in a Symfony 2 application:
Closing, Sorry for the long feedback loop. This is a common pattern for event-handing, the advantages for a static method are that event registration is context free and can be done at build stage. (see symfony event dispatcher)
I wonder if the
getSubscribingMethods
method of theSubscribingHandlerInterface
needs to be static ?IMO, this is limiting, as we could not access to the handler instance properties.
Accessing it might be useful in order to configure the supported formats and types from a service container definition.
e.g: I've got a basic
Enum
class. ThisEnum
class is extended from 3 other classes, doing the same things, but defining different constants. The serializer must do the exact same work for those classes. So in order to do that, I'd like to do such a thing in a Symfony 2 application:The given argument will be the supported type for the handler instance.
I think my example could be solved easily when the #377 will be merged. But there could be other use cases.
The text was updated successfully, but these errors were encountered: