Skip to content

ContainerException

github-actions[bot] edited this page Oct 16, 2026 · 3 revisions

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.


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

Methods

forCircularDependency

Creates an exception describing the active dependency cycle.

public static forCircularDependency(list<string> $path): self
  • This method is static. Parameters:
Parameter Type Description
$path list the service identifiers, including the repeated entry

Return Value:

an exception preserving the complete resolution path


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.

  • This method is static. Parameters:
Parameter Type Description
$id string the identifier of the service that caused the failure
$previous \Throwable the previous exception thrown during resolution

Return Value:

an instance of ContainerException describing the issue


Clone this wiki locally