Newscoop\Service\Implementation\ThemeServiceLocalFileSystem::readAttribute PHP Méthode

readAttribute() protected méthode

This method will throw an exception in case the attribute is not specified.
protected readAttribute ( SimpleXMLElement $node, string $attribute ) : string
$node SimpleXMLElement The node to read from, *(not null not empty).
$attribute string The attribute name, *(not null not empty).
Résultat string The attribute value, not null.
    protected function readAttribute(\SimpleXMLElement $node, $attribute)
    {
        $value = $node[$attribute];
        if (!isset($value)) {
            throw new XMLMissingAttribueException($attribute);
        }
        return $value;
    }