On Mon, Jul 12, 2021 at 10:36 PM Mike Schinkel <m...@newclarity.net> wrote:

>
> In your hypothetical view here, what happens when the $container does not
> have SomeService to provide?  Does it throw an Exception?
>
>
Up to the developer that implements it. If the signature would be
`get<T>(?string $id): T;` then I would assume an error should be thrown by
PHP, or an Exception by the method, or handled by the developer to always
return `T`. `?SomeException` as `T` could let the developer not throw an
exception if needed and return `null` instead.

Reply via email to