HandlerStack
class HandlerStack implements HandlerStackInterface (View source)
SimplePie\HandlerStack
is a middleware stack system which is modeled after
Guzzle's middleware handler stack system,
but is designed specifically for SimplePie's use-cases.
Its primary job is to (a) allow the registration and priority of middleware, and (b) provide the interface for SimplePie NG to trigger middleware.
Traits
Properties
protected LoggerInterface | $logger | A PSR-3 logger. | from LoggerTrait |
protected array | $stack | The middleware stack, grouped by feed type. |
Methods
Constructs a new instance of this class.
Appends a new middleware class onto the end of the stack.
Appends a new middleware closure onto the end of the stack.
Prepends a new middleware class onto the beginning of the stack.
Prepends a new middleware closure onto the beginning of the stack.
Returns information about the HandlerStack that is useful for debugging.
Validates the middleware and applies it to the right stack.
Log that the registration of the middleware occurred.
Generate the most appropriate error message based on the parameters that were passed.
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 46
__construct()
Constructs a new instance of this class.
at line 60
HandlerStackInterface
append(callable $middleware, string|null $name = null, string|null $overrideType = null)
Appends a new middleware class onto the end of the stack.
at line 84
HandlerStackInterface
appendClosure(string $overrideType, callable $middleware, string|null $name = null)
Appends a new middleware closure onto the end of the stack.
at line 99
HandlerStackInterface
prepend(callable $middleware, string|null $name = null, string|null $overrideType = null)
Prepends a new middleware class onto the beginning of the stack.
at line 123
HandlerStackInterface
prependClosure(string $overrideType, callable $middleware, string|null $name = null)
Prepends a new middleware closure onto the beginning of the stack.
at line 136
void
invoke(string $feedType, stdClass $feedRoot, string|null $namespaceAlias, DOMXPath $xpath)
Invokes the stack of middleware.
at line 164
void
registerNamespaces(Ns $ns)
Collects all of the supported namespaces from the registered middleware.
NOTE: Only significant for XML-based feed types.
at line 175
array
debugStack()
Returns information about the HandlerStack that is useful for debugging.
at line 211
protected void
validateMiddleware(callable $middleware, string|null $name, string|null $overrideType, callable $fn)
Validates the middleware and applies it to the right stack.
at line 240
protected void
logRegistration(callable $middleware, string|null $name = null)
Log that the registration of the middleware occurred.
at line 255
protected string
exceptionMessage(callable $middleware, string|null $name = null)
Generate the most appropriate error message based on the parameters that were passed.