Definition at line 4 of file XPath.php.
◆ __construct()
enshrined\svgSanitize\data\XPath::__construct |
( |
\DOMDocument |
$doc | ) |
|
◆ createNodeName()
enshrined\svgSanitize\data\XPath::createNodeName |
( |
|
$nodeName | ) |
|
- Parameters
-
- Returns
- string
Definition at line 23 of file XPath.php.
24 {
25 if (empty($this->defaultNamespaceURI)) {
26 return $nodeName;
27 }
28 return self::DEFAULT_NAMESPACE_PREFIX . ':' . $nodeName;
29 }
◆ handleDefaultNamespace()
enshrined\svgSanitize\data\XPath::handleDefaultNamespace |
( |
| ) |
|
|
protected |
Definition at line 31 of file XPath.php.
32 {
33 $rootElements = $this->getRootElements();
34
35 if (count($rootElements) !== 1) {
36 throw new \LogicException(
37 sprintf(
'Got %d svg elements, expected exactly one', count($rootElements)),
38 1570870568
39 );
40 }
41 $this->defaultNamespaceURI = (string)$rootElements[0]->namespaceURI;
42
43 if ($this->defaultNamespaceURI !== '') {
44 $this->registerNamespace(self::DEFAULT_NAMESPACE_PREFIX, $this->defaultNamespaceURI);
45 }
46 }
sprintf('%.4f', $callTime)
References sprintf.
Referenced by enshrined\svgSanitize\data\XPath\__construct().
◆ $defaultNamespaceURI
enshrined\svgSanitize\data\XPath::$defaultNamespaceURI |
|
protected |
◆ DEFAULT_NAMESPACE_PREFIX
const enshrined\svgSanitize\data\XPath::DEFAULT_NAMESPACE_PREFIX = 'svg' |
The documentation for this class was generated from the following file:
- libs/composer/vendor/enshrined/svg-sanitize/src/data/XPath.php