AbstractMiddleware
abstract class AbstractMiddleware implements SetLoggerInterface (View source)
The base middleware class that all other middleware classes extend from. It handles low-level functionality that is shared across all middleware classes.
Traits
Properties
protected LoggerInterface | $logger | A PSR-3 logger. | from LoggerTrait |
protected callable | $fn | A callable which is used to determine whether or not to run this middleware. |
Methods
Constructs a new instance of this class.
Checks whether or not a particular property exists on an object, and if not, instantiates it as an array.
Return the value of an associative array key, if it exists. If not, return $default.
Details
in LoggerTrait at line 35
LoggerTrait
setLogger(LoggerInterface $logger)
Sets the PSR-3 logger.
in LoggerTrait at line 52
LoggerInterface
getLogger()
Retrieves the PSR-3 logger.
at line 45
__construct(callable|null $fn = null)
Constructs a new instance of this class.
Accepts a callable with the following function signature:
function () {}
at line 58
void
addArrayProperty(mixed $object, string $property)
Checks whether or not a particular property exists on an object, and if not, instantiates it as an array.
at line 72
get(array $arr, string $key, mixed $default = null)
Return the value of an associative array key, if it exists. If not, return $default.