RuntimeException
Exception type used to represent runtime errors specific to the container context.
Description
This class MUST be thrown when an error occurs due to invalid runtime behavior such as misconfigured extensions or illegal method accessibility.
Methods
Creates an exception for an invalid parameter type.
Creates an exception for a non-callable service extension.
Creates an exception for attempting to use a non-public method.
Creates an exception for an invalid parameter type.
public
static
forInvalidParameterType(
string
$parameter) : self
Description
This method MUST be used when a parameter expected to represent a class name or interface name does not satisfy this constraint.
Parameters
$parameter
:
string
Description
the name of the parameter with the invalid type
Return values
Description
a RuntimeException instance with a descriptive message
Creates an exception for a non-callable service extension.
public
static
forNonCallableExtension(
string
$service,
string
$given) : self
Description
This method MUST be used when a value intended to act as a service extension is not callable, violating the expected contract of container extensions.
Parameters
$service
:
string
Description
the identifier of the service with the invalid extension
$given
:
string
Description
the type or class name of the invalid value
Return values
Description
a RuntimeException instance with a descriptive message
Creates an exception for attempting to use a non-public method.
public
static
forNonPublicMethod(
string
$class,
string
$method) : self
Description
This method SHOULD be used when trying to invoke a method that is not declared public, thereby violating service visibility requirements.
Parameters
$class
:
string
Description
the fully qualified class name
$method
:
string
Description
the name of the method that is not publicly accessible
Return values
Description
a RuntimeException indicating the method MUST be public