ContainerException
extends Exception
in package
implements
ContainerExceptionInterface
FinalYes
Exception type for container-related errors while resolving services.
This class MUST be used to signal problems occurring during service resolution from a container that complies with PSR-11.
Table of Contents
Interfaces
- ContainerExceptionInterface
Methods
- forInvalidService() : self
- Creates an exception for an invalid or unresolvable service identifier.
Methods
forInvalidService()
Creates an exception for an invalid or unresolvable service identifier.
public
static forInvalidService(string $id, Throwable $previous) : self
This factory method MUST be invoked when a service ID fails to resolve or the resolved service is invalid in the current context.
Parameters
- $id : string
-
the identifier of the service that caused the failure
- $previous : Throwable
-
the previous exception thrown during resolution
Return values
self —an instance of ContainerException describing the issue