Copied!

Provides a top-level abstract implementation of IErrorBag.

Abstract
Methods
public __construct(Psr\Log\LoggerInterface $logger)
public addError(string $message, string $psrLogLevel, ?Throwable $exception = NULL) : static
public getAllErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : array
public getErrorLoggingContextName() : string
 

Returns the class name. Override to identify objects in logs.

public getErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : array
public hasAnyErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : bool
public hasErrors(bool $validate = false, string $minPsrLevel = 'error'Psr\Log\LogLevel::ERROR) : bool
Properties
protected Psr\Log\LoggerInterface $logger
Methods
protected abstract getErrorBagChildren() : array
 

Return any children ErrorBag objects.

  • return \IErrorBag[]
protected validate() : void
 

Perform any extra validation and call 'addError'.

getErrors and getAllErrors call validate() if their $validate parameter is true. validate() is only called once on an object with getErrors getAllErrors.

Properties
private array $errors = []
 
  • var \Error[] array of Error objects belonging to this object.
private bool $validated = false
 
  • var bool true once the object has been validated.
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration