Hi Nicolas,

Thanks for the effort to move this forward.
Regarding you last suggestion I'm having trouble seeing the difference with the 
current version of the spec, could you pinpoint it more explicitly?

Thanks
Matthieu

On 15 janv. 2017 à 08:48 +0100, Nicolas Grekas <nicolas.gre...@gmail.com>, 
wrote:
> Hi David,
>
> > > let's drop any distinction between "entry not found" and "dependency 
> > > missing". We don't need this because users of containers can anyway 
> > > figure that out.
> >
> > I'd like to propose the opposite alternative. That's no a rebuttal of yours 
> > and I sincerely thank you for being so open to comments.
> > Let's see:
> > My naïve question was "doesn't that concept [NotFoundExceptionInterface] 
> > duplicate the "has()" method?"
> >
> > Your new proposal is to answer a strict "no" to this question, thus remove 
> > the exception all together.
> > What about answering it with a strict "yes"?
> >
> > What I mean is to keep NotFoundExceptionInterface and define it a to be 
> > thrown by "get" only and only if would have returned false.
> > I think that would fix Larry's comments, and more importantly, fix any 
> > ambiguity and the semantic of this exception.
> >
> > So, to sum up, error handling in PSR11 could look like:
> >
> > - "has" never throws anything but instanceof \Error - it only returns 
> > true/false
> > - "get" throws NotFoundExceptionInterface whenever "has" would have 
> > returned false - it "directly" throws ContainerExceptionInterface - and is 
> > allowed to let anything else bubble if thrown by the factories/initializers 
> > it calls.
> >
> >
> > > It also enforces best practices as users that want to check if an entry 
> > > exists will use has instead of NotFoundExceptionInterface (the exception 
> > > can no more be used for control flow)
> >
> > This is the main difference with your proposal: NotFoundExceptionInterface 
> > could be used for flow control. But since doing so would be strictly 
> > equivalent to call "has", we could even add in the PSR a SHOULD NOT - if 
> > worth it.
> >
> > Does it make sense?
> >
> > Nicolas
> >
> >
> >
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "PHP Framework Interoperability Group" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/php-fig/I1a2Xzv9wN8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> php-fig+unsubscr...@googlegroups.com.
> To post to this group, send email to php-fig@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/php-fig/CAOWwgpmQZnbvCfLkE58mDhBT3NHCWqdkPabPEsJRkezTHZm-AQ%40mail.gmail.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 php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/29448f78-47c8-4c6e-af6c-a070d0cdf018%40Spark.
For more options, visit https://groups.google.com/d/optout.

Reply via email to