On 13/01/2017 16:48, Fabien Potencier wrote:
I do understand that the group spent a lot of time trying to figure out
something that works for most projects, and I really appreciate their
work, but **can we admit that the result is deceptive and not useful
enough to standardize?**
I disagree.
Before this PSR, most containers relied on __get magic methods, with no
rules on keys or errors.
An interface is not just the function name. it's mostly its signature:
what it accepts, what it returns, what errors it can generate/throw.
This PSR makes containers interoperable, because a well-made container
knows other containers will have the same interface (and exceptions), so
if it wants to implement delegation, it can do it easily.
It makes libraries interoperable, because they abstract over the container.
It makes applications interoperable, because you can just change the
container and its configuration in the bootstrap and the rest of the app
continues working without changes.
It's simple, yes, but that's a plus, not a defect.
A way to re-introduce delegation into the specs would be, for example,
to define the exceptions thrown when delegation fails.
It's quite logical that if a container adheres to the specs just by
wrapping its external interface, it loses the advantages of delegation.
You need to change the inner working to take advantage of it, but with
this PSR you can do it.
I still haven't made up my mind around the cascade gets exceptions, but
I think this PSR is quite important as it is.
Bye.
--
You received this message because you are subscribed to the Google Groups "PHP
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/b427d08a-a54c-7a04-204b-835fe04cc193%40amiran.it.
For more options, visit https://groups.google.com/d/optout.