| Total Complexity | 7 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class EidasRequestedAttributes extends Chunk |
||
| 9 | { |
||
| 10 | |||
| 11 | const NS_EIDAS = 'http://eidas.europa.eu/saml-extensions'; |
||
| 12 | const LOCAL_NAME = 'RequestedAttributes'; |
||
| 13 | /**@var $requested_attributes EidasRequestedAttribute[] */ |
||
|
|
|||
| 14 | public $requested_attributes = []; |
||
| 15 | |||
| 16 | public function __construct(DOMElement $xml = null) |
||
| 17 | { |
||
| 18 | if (!empty($xml) && $xml->localName != self::LOCAL_NAME) { |
||
| 19 | $xml = $xml->ownerDocument->getElementsByTagNameNS(self::NS_EIDAS, self::LOCAL_NAME)->item(0); |
||
| 20 | } |
||
| 21 | if (empty($xml)) { |
||
| 22 | return; |
||
| 23 | } |
||
| 24 | parent::__construct($xml); |
||
| 25 | foreach ($xml->getElementsByTagNameNS(self::NS_EIDAS, EidasRequestedAttribute::LOCAL_NAME) as $requestedAttr) { |
||
| 26 | $this->requested_attributes[] = new EidasRequestedAttribute($requestedAttr); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | public function toXML(DOMElement $parent): DOMElement |
||
| 38 | } |
||
| 39 | } |