Class ErrorCollection
An error collection.
- ICanBoogie\ErrorCollection implements ArrayAccess, IteratorAggregate, Countable, JsonSerializable, ICanBoogie\ToArray
Direct known subclasses
Methods summary
public
add( string $attribute
, ICanBoogie\Error
|string|boolean $error_or_format_or_true
= true, array $args
= [] )
: ICanBoogie\ErrorCollection
Add an error associated with an attribute.
public
add_generic( ICanBoogie\Error
|string|boolean $error_or_format_or_true
= true, array $args
= [] )
: ICanBoogie\ErrorCollection
Add an error not associated with any attribute.
protected
assert_valid_error( mixed $error_or_format_or_true
)
Asserts that the error type is valid.
protected
ensure_error_instance( ICanBoogie\Error
|string|boolean $error_or_format_or_true
, array $args
= [] )
: ICanBoogie\Error
Ensures a ICanBoogie\Error
instance.
public
offsetExists( string|null $attribute
)
: boolean
Checks if an error is defined for an attribute.
public
offsetGet( string|null $attribute
)
: ICanBoogie\Error[]
Returns errors associated with an attribute.