Closed ahmadnazir closed 9 years ago
The reason to use __invoke is that the processor "interface" is just a any callable. It makes it possible to use anonymous functions as minimalistic processors for example. There is no need for more than that so I don't see the benefit of introducing an actual interface.
@Seldaek however sometimes interfaces can be useful in OOP-based projects.
For example, in Symfony it's required to put monolog.processor
tag on processor services. But if there was ProcessorInterface
, I could map it on tag and avoid explicit tags.
Hi,
I was wondering what is that reason to rely on the magic __invoke method inside the processors. I would expect that the processors should implement a ProcessorInterface with at least the following methods:
What are your thoughts? If it makes sense, I am interested in working on it and sending a pull request.