SAML2\XML\md\ContactPerson::getStringElement PHP Method

getStringElement() private static method

Retrieve the value of a child \DOMElement as a string.
private static getStringElement ( DOMElement $parent, string $name ) : string | null
$parent DOMElement The parent element.
$name string The name of the child element.
return string | null The value of the child element.
    private static function getStringElement(\DOMElement $parent, $name)
    {
        assert('is_string($name)');
        $e = self::getStringElements($parent, $name);
        if (empty($e)) {
            return null;
        }
        if (count($e) > 1) {
            throw new \Exception('More than one ' . $name . ' in ' . $parent->tagName);
        }
        return $e[0];
    }