Static guard helper class

Bridges the gap for allowing refactoring until traits can be used by default.

deprecated

 Methods

Verify that the data is not empty

guardAgainstEmpty(mixed $data, string $dataName, string $exceptionClass) 

Parameters

$data

mixed

the data to verify

$dataName

string

the data name

$exceptionClass

string

FQCN for the exception

Exceptions

\Exception

Verify that the data is not null

guardAgainstNull(mixed $data, string $dataName, string $exceptionClass) 

Parameters

$data

mixed

the data to verify

$dataName

string

the data name

$exceptionClass

string

FQCN for the exception

Exceptions

\Exception

Verifies that the data is an array or Traversable

guardForArrayOrTraversable(mixed $data, string $dataName, string $exceptionClass) 

Parameters

$data

mixed

the data to verify

$dataName

string

the data name

$exceptionClass

string

FQCN for the exception

Exceptions

\Exception

 Constants

 

DEFAULT_EXCEPTION_CLASS

DEFAULT_EXCEPTION_CLASS