SimpleSAML_Metadata_SAMLParser::parseRoleDescriptorType PHP Method

parseRoleDescriptorType() private static method

The returned associative array has the following elements: - 'protocols': Array with the protocols supported. - 'expire': Timestamp for when this descriptor expires. - 'keys': Array of associative arrays with the elements from parseKeyDescriptor.
private static parseRoleDescriptorType ( SAML2\XML\md\RoleDescriptor $element, integer | null $expireTime ) : array
$element SAML2\XML\md\RoleDescriptor The element we should extract metadata from.
$expireTime integer | null The unix timestamp for when this element should expire, or NULL if unknown.
return array An associative array with metadata we have extracted from this element.
    private static function parseRoleDescriptorType(\SAML2\XML\md\RoleDescriptor $element, $expireTime)
    {
        assert('is_null($expireTime) || is_int($expireTime)');
        $ret = array();
        $expireTime = self::getExpireTime($element, $expireTime);
        if ($expireTime !== null) {
            // we got an expired timestamp, either from this element or one of the parent elements
            $ret['expire'] = $expireTime;
        }
        $ret['protocols'] = $element->protocolSupportEnumeration;
        // process KeyDescriptor elements
        $ret['keys'] = array();
        foreach ($element->KeyDescriptor as $kd) {
            $key = self::parseKeyDescriptor($kd);
            if ($key !== null) {
                $ret['keys'][] = $key;
            }
        }
        $ext = self::processExtensions($element);
        $ret['scope'] = $ext['scope'];
        $ret['tags'] = $ext['tags'];
        $ret['EntityAttributes'] = $ext['EntityAttributes'];
        $ret['UIInfo'] = $ext['UIInfo'];
        $ret['DiscoHints'] = $ext['DiscoHints'];
        return $ret;
    }