On the exceptions, that language just says to me that in my get() method, I have a try/catch around any deeper get() calls, and thus my outer get is going to catch *anything* and wrap it with the package-level exception before throwing it. It's not really about the source exception being NotFound... it's about the package-level exception behavior in general.
Maybe that language should be more generic regarding the inner exception? Maybe the use pattern should be presumed rather than specified. Then again, maybe the fact that the exception that comes out *is* a package-level exception should be good enough, since even the NotFound *will* be caught by catching the package-level exception. If that was actually your point, Larry, I think I can accept that. This has highlighted to me that a package *sub-level* _interface_ is not the same animal as a package sub-level *concrete* exception class, and requires a different viewpoint when seeing the runtime scenarios. On Jan 12, 2017 5:08 PM, "Larry Garfield" <[email protected]> wrote: > Late in the week, I know, but this is when I had time. :-( > > One: > > " A call to get can trigger additional calls to get (to fetch the > dependencies). If one of those dependencies is missing, the > NotFoundExceptionInterface triggered by the inner get call SHOULD NOT > bubble out. Instead, it should be wrapped in an exception implementing the > ContainerExceptionInterface that does not implement > theNotFoundExceptionInterface." > > I still find this language unacceptably vague and backward. "Throw > something implementing X but not Y which is a child of X" is needlessly > clumsy. There was, previously, a suggestion to define a > "MissingDependencyException" to use specifically, which is more targeted > than "MisconfiguredServiceException" (and avoids the "breaks how PHP > works" issue that David noted previously). At the very least specifying > that as the exception to throw (which is defined, and therefore we know it > doesn't extent NotFoundException) the above language becomes much simpler, > and for those who do wish to catch it there's a very clear known value to > catch. > > I will be honest, I find the idea of "Don't define an exception for a > known error case because *I* can't think of a reason you'd catch that" to > be spurious at best. It provides for more robust error handling in some > cases, and zero harm in any case. Even if you could argue the > justification for it is small, the justification against it is non-existent > (when limited to just missing dependencies). > > Two: > > I understand the reasons why the delegate lookup was removed outright, and > I do not dispute them. However, the net result is that we have an > interface that is almost trivial, on a topic that is of questionable > appropriateness in the first place. (I still question the validity of a > container interface at all.) That is, with that removed, what's left to > standardize? get() and has() are barely an specification. > > Three: > > There's a formatting issue in the metadoc, 9.3, contributors: Taylor > Otwell is separated from the rest of the group for some reason. I'm sure > there's nothing to be read into that. :-) > > --Larry Garfield > > On 12/31/2016 02:57 PM, Matthew Weier O'Phinney wrote: > >> Greetings, on this last day of 2016! (For some of you, it's already 2017!) >> >> I'm rebooting the REVIEW period for PSR-11 as of now; review will end >> at 11:59 on 13 January 2017, with the possibility of starting a vote >> under the existing FIG 2.0 by-laws possible immediately thereafter. >> >> The changes since the previous review period started include: >> >> - All exceptions were moved into the `Psr\Container` namespace >> (instead of the `Psr\Container\Exception` namespace as was done >> previously). >> >> - Clarifications were added around inclusion of OPTIONAL parameters to >> the `get()` method by _implementing libraries_, noting that doing so >> is allowed by PHP, but discouraged, due to ambiguity in behavior >> between implementations. >> >> - Added a formal definition of an entry identifier for use with >> `get()` and `has()`, noting that these may be any valid non-empty >> string. >> >> - Removed all verbiage around the delegate lookup feature. Consensus >> was that this is an interesting feature, but something that may be >> implemented by libraries while still following the specification. If >> anybody feels the need to formalize this detail, it can be done in a >> later specification without breaking compatibility with the current >> proposal. >> >> We have also rejected the proposed >> `MisconfiguredServiceExceptionInterface`. David has previously noted >> reasons not to include it >> (https://groups.google.com/d/msg/php-fig/2pnhudRUpQg/ewoGoNtFCgAJ), >> which received no rebuttal. We feel it does not add value to consumers >> currently, would likely be problematic in terms of performance, and >> dictates too many details around implementation. >> >> Please review the specification again at this time, and let us know as >> soon as possible if you see any potential problems that remain to be >> addressed. >> >> > -- > 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/ms > gid/php-fig/a77b3d96-2edf-e5ad-4cc1-d41ffaa9a9b1%40garfieldtech.com. > For more options, visit https://groups.google.com/d/optout. > -- 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/CANsgjntdPeguv%2B4RJx1J%3D_%3D22sprh%3DiKcNozo9uAUFPXd2Z8Eg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
