NotFoundException
extends Exception
in package
implements
NotFoundExceptionInterface
FinalYes
Exception thrown when a requested service identifier is not found in the container.
This class MUST be used in PSR-11 container implementations to represent an error condition where a service ID does not exist in the container. It implements the Psr\Container\NotFoundExceptionInterface to guarantee interoperability with PSR-11 consumers.
Table of Contents
Interfaces
- NotFoundExceptionInterface
Methods
- forServiceID() : self
- Creates a new NotFoundException for a missing service identifier.
Methods
forServiceID()
Creates a new NotFoundException for a missing service identifier.
public
static forServiceID(string $id) : self
This factory method SHOULD be used by the container implementation to report the absence of a given service ID. The resulting exception message SHALL clearly indicate which identifier was not resolved.
Parameters
- $id : string
-
the service identifier that was not found
Return values
self —an instance of NotFoundException describing the missing service