interface HandlerStackInterface implements SetLoggerInterface (View source)

Provides an interface for SimplePie\HandlerStack to implement.

Methods

setLogger(LoggerInterface $logger)

No description

append(callable $middleware, string|null $name = null, string|null $overrideType = null)

Appends a new middleware class onto the end of the stack.

appendClosure(string $overrideType, callable $middleware, string|null $name = null)

Appends a new middleware closure onto the end of the stack.

prepend(callable $middleware, string|null $name = null, string|null $overrideType = null)

Prepends a new middleware class onto the beginning of the stack.

prependClosure(string $overrideType, callable $middleware, string|null $name = null)

Prepends a new middleware closure onto the beginning of the stack.

void
invoke(string $feedType, stdClass $feedRoot, string|null $namespaceAlias, DOMXPath $xpath)

Invokes the stack of middleware.

void
registerNamespaces(Ns $ns)

Collects all of the supported namespaces from the registered middleware.

Details

setLogger(LoggerInterface $logger)

Parameters

LoggerInterface $logger

HandlerStackInterface append(callable $middleware, string|null $name = null, string|null $overrideType = null)

Appends a new middleware class onto the end of the stack.

Parameters

callable $middleware The middleware to add to the stack.
string|null $name A name for the middleware. Can be used with pushBefore() and pushAfter().
string|null $overrideType Override our best guess for which stack to apply the middleware to. By default the appropriate stack will be determined by which SimplePie\Middleware\*\*Interface the middleware extends from. If the middleware is a closure, this parameter is required. If the appropriate stack cannot be determined, a SimplePie\Exception\MiddlewareException exception will be thrown.

Return Value

HandlerStackInterface

Exceptions

MiddlewareException

HandlerStackInterface appendClosure(string $overrideType, callable $middleware, string|null $name = null)

Appends a new middleware closure onto the end of the stack.

Parameters

string $overrideType Override our best guess for which stack to apply the middleware to. By default the appropriate stack will be determined by which SimplePie\Middleware\*\*Interface the middleware extends from. If the middleware is a closure, this parameter is required. If the appropriate stack cannot be determined, a SimplePie\Exception\MiddlewareException exception will be thrown.
callable $middleware The middleware to add to the stack.
string|null $name A name for the middleware. Can be used with pushBefore() and pushAfter().

Return Value

HandlerStackInterface

Exceptions

MiddlewareException

HandlerStackInterface prepend(callable $middleware, string|null $name = null, string|null $overrideType = null)

Prepends a new middleware class onto the beginning of the stack.

Parameters

callable $middleware The middleware to add to the stack.
string|null $name A name for the middleware. Can be used with pushBefore() and pushAfter().
string|null $overrideType Override our best guess for which stack to apply the middleware to. By default the appropriate stack will be determined by which SimplePie\Middleware\*\*Interface the middleware extends from. If the middleware is a closure, this parameter is required. If the appropriate stack cannot be determined, a SimplePie\Exception\MiddlewareException exception will be thrown.

Return Value

HandlerStackInterface

Exceptions

MiddlewareException

HandlerStackInterface prependClosure(string $overrideType, callable $middleware, string|null $name = null)

Prepends a new middleware closure onto the beginning of the stack.

Parameters

string $overrideType Override our best guess for which stack to apply the middleware to. By default the appropriate stack will be determined by which SimplePie\Middleware\*\*Interface the middleware extends from. If the middleware is a closure, this parameter is required. If the appropriate stack cannot be determined, a SimplePie\Exception\MiddlewareException exception will be thrown.
callable $middleware The middleware to add to the stack.
string|null $name A name for the middleware. Can be used with pushBefore() and pushAfter().

Return Value

HandlerStackInterface

Exceptions

MiddlewareException

void invoke(string $feedType, stdClass $feedRoot, string|null $namespaceAlias, DOMXPath $xpath)

Invokes the stack of middleware.

Parameters

string $feedType A valid single feed type from SimplePie\Enum\FeedType. Since FeedType::ALL represents multiple feed types, an exception will be thrown if it is used.
stdClass $feedRoot The root of the feed. This will be written-to when the parsing middleware runs.
string|null $namespaceAlias The preferred namespace alias for a given XML namespace URI. Should be the result of a call to SimplePie\Util\Ns.
DOMXPath $xpath The DOMXPath object with this middleware's namespace alias applied.

Return Value

void

void registerNamespaces(Ns $ns)

Collects all of the supported namespaces from the registered middleware.

NOTE: Only significant for XML-based feed types.

Parameters

Ns $ns The XML namespace handler.

Return Value

void