Closed kminek closed 9 years ago
For the record it seems to come from here: https://github.com/slimphp/Slim/blob/develop/Slim/Container.php#L169
That's weird. This test code doesn't work either:
require "vendor/autoload.php";
$exception = new \Interop\Container\Exception\NotFoundException;
you did a composer update? container-interop is a new dependency.
No, it's because NotFoundException
is an interface, not a concrete class.
I'm surprised that container-interop doesn't have a concrete class.
Ohw haha thats a stupid mistake xD
And this is one of the times when a good IDE is helpful in development. :-)
I'm surprised that container-interop doesn't have a concrete class.
The idea is to be less invasive to existing DI containers: they can keep throwing their own exceptions, they just have to implement the interface. Most containers do have their own NotFoundException
.
And from the consumer POV, the fact that it's an interface doesn't impact the catch (NotFoundException $e) ...
.
oh, I wasn't querying the interface, just that there wasn't a concrete implementation of it in addition :)
yes it could be added for practical purposes, but I'm afraid it could encourage some people to consider it part of the standard and to use it/type-hint against it instead of the interface (which would break if another implementation of the interface is passed later).
Yeah, I tend to agree.
above error pops-up after latest changes - this is interface only: Interop/Container/Exception/NotFoundException.php