ErrorCollection extends Dictionary
Table of Contents
Methods
- __construct() : mixed
- Constructor ErrorCollection.
- __unserialize() : void
- add() : void
- Adds an array of errors to the collection.
- clear() : mixed
- get() : string|array<string|int, mixed>|null
- Returns any variable by its name. Null if variable is not set.
- getErrorByCode() : Error|null
- Returns an error with the necessary code.
- getValues() : array<string|int, mixed>
- isEmpty() : bool
- Returns true if the dictionary is empty.
- jsonSerialize() : array<string|int, mixed>
- JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
- offsetSet() : mixed
- \ArrayAccess thing.
- set() : mixed
- setError() : void
- Adds an error to the collection.
- setValues() : mixed
- toArray() : array<string|int, mixed>
- Returns the values as an array.
Methods
__construct()
Constructor ErrorCollection.
public
__construct([array<string|int, Error> $values = null ]) : mixed
Parameters
- $values : array<string|int, Error> = null
-
Initial errors in the collection.
__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
add()
Adds an array of errors to the collection.
public
add(array<string|int, Error> $errors) : void
Parameters
- $errors : array<string|int, Error>
clear()
public
clear() : mixed
get()
Returns any variable by its name. Null if variable is not set.
public
get(string $name) : string|array<string|int, mixed>|null
Parameters
- $name : string
Return values
string|array<string|int, mixed>|nullgetErrorByCode()
Returns an error with the necessary code.
public
getErrorByCode(string|int $code) : Error|null
Parameters
- $code : string|int
-
The code of the error.
Return values
Error|nullgetValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>isEmpty()
Returns true if the dictionary is empty.
public
isEmpty() : bool
Return values
booljsonSerialize()
JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
public
jsonSerialize() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>offsetSet()
\ArrayAccess thing.
public
offsetSet(mixed $offset, mixed $value) : mixed
Parameters
- $offset : mixed
- $value : mixed
set()
public
set(mixed $name[, mixed $value = null ]) : mixed
Parameters
- $name : mixed
- $value : mixed = null
setError()
Adds an error to the collection.
public
setError(Error $error[, mixed $offset = null ]) : void
Parameters
- $error : Error
-
An error object.
- $offset : mixed = null
-
Offset in the array.
setValues()
public
setValues(mixed $values) : mixed
Parameters
- $values : mixed
toArray()
Returns the values as an array.
public
toArray() : array<string|int, mixed>