Skip to content

RuntimeException

Felipe Sayão Lobato Abreu edited this page Jul 3, 2025 · 2 revisions

RuntimeException

Exception type used to represent runtime errors specific to the container context.

This class MUST be thrown when an error occurs due to invalid runtime behavior such as misconfigured extensions or illegal method accessibility.

  • Full name: \FastForward\Container\Exception\RuntimeException
  • Parent class: RuntimeException
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

forNonCallableExtension

Creates an exception for a non-callable service extension.

public static forNonCallableExtension(string $service, string $given): self

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.

  • This method is static.

Parameters:

Parameter Type Description
$service string the identifier of the service with the invalid extension
$given string the type or class name of the invalid value

Return Value:

a RuntimeException instance with a descriptive message


forNonPublicMethod

Creates an exception for attempting to use a non-public method.

public static forNonPublicMethod(string $class, string $method): self

This method SHOULD be used when trying to invoke a method that is not declared public, thereby violating service visibility requirements.

  • This method is static.

Parameters:

Parameter Type Description
$class string the fully qualified class name
$method string the name of the method that is not publicly accessible

Return Value:

a RuntimeException indicating the method MUST be public


forInvalidParameterType

Creates an exception for an invalid parameter type.

public static forInvalidParameterType(string $parameter): self

This method MUST be used when a parameter expected to represent a class name or interface name does not satisfy this constraint.

  • This method is static.

Parameters:

Parameter Type Description
$parameter string the name of the parameter with the invalid type

Return Value:

a RuntimeException instance with a descriptive message



Automatically generated on 2025-07-03

Clone this wiki locally