AbstractXmlMiddleware
abstract class AbstractXmlMiddleware extends AbstractMiddleware (View source)
The base XML middleware class that all other XML middleware classes extend from. It handles low-level functionality that is shared across all XML 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. | from AbstractMiddleware |
protected bool | $caseSensitive | The status of case-sensitivity. |
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.
By default, SimplePie NG is case-sensitive (as per the specification). If an invalid feed is parsed that does not follow the specification with regard to casing of XML elements, this method allows you to trade some performance in favor of case-insensitive parsing.
Replace all instances of %s
with the $namespaceAlias
parameter.
Produce an XPath 1.0 expression which is used to query XML document nodes.
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.
in AbstractMiddleware at line 45
__construct(callable|null $fn = null)
Constructs a new instance of this class.
Accepts a callable with the following function signature:
function () {}
in AbstractMiddleware 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.
in AbstractMiddleware 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.
at line 38
AbstractXmlMiddleware
setCaseInsensitive(bool $makeInsensitive = true)
By default, SimplePie NG is case-sensitive (as per the specification). If an invalid feed is parsed that does not follow the specification with regard to casing of XML elements, this method allows you to trade some performance in favor of case-insensitive parsing.
at line 53
string
applyNsToQuery(string $query, string $namespaceAlias)
Replace all instances of %s
with the $namespaceAlias
parameter.
This is similar to sprintf()
, but the $namespaceAlias
is applied to all instances of %s
.
at line 77
string
generateQuery(string $namespaceAlias, array $path)
Produce an XPath 1.0 expression which is used to query XML document nodes.
['feed', 'entry', 5, 'id', '@xml:lang']
/feed/entry[5]/id/@xml:lang (simplified)