1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\WSSecurity\XML\auth; |
6
|
|
|
|
7
|
|
|
use DOMElement; |
8
|
|
|
use SimpleSAML\WSSecurity\Assert\Assert; |
9
|
|
|
use SimpleSAML\XML\Exception\InvalidDOMElementException; |
10
|
|
|
use SimpleSAML\XML\ExtendableAttributesTrait; |
11
|
|
|
use SimpleSAML\XML\StringElementTrait; |
12
|
|
|
use SimpleSAML\XML\XsNamespace as NS; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Class representing WS-authorization DisplayValueType. |
16
|
|
|
* |
17
|
|
|
* @package simplesamlphp/ws-security |
18
|
|
|
*/ |
19
|
|
|
abstract class AbstractDisplayValueType extends AbstractAuthElement |
20
|
|
|
{ |
21
|
|
|
use ExtendableAttributesTrait; |
22
|
|
|
use StringElementTrait; |
23
|
|
|
|
24
|
|
|
/** The namespace-attribute for the xs:anyAttribute element */ |
25
|
|
|
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; |
26
|
|
|
|
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* AbstractDisplayValueType constructor. |
30
|
|
|
* |
31
|
|
|
* @param string $value The value string. |
32
|
|
|
* @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes |
|
|
|
|
33
|
|
|
*/ |
34
|
|
|
final public function __construct(string $value, array $namespacedAttributes = []) |
35
|
|
|
{ |
36
|
|
|
$this->setContent($value); |
37
|
|
|
$this->setAttributesNS($namespacedAttributes); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Convert XML into a class instance |
43
|
|
|
* |
44
|
|
|
* @param \DOMElement $xml The XML element we should load |
45
|
|
|
* @return static |
46
|
|
|
* |
47
|
|
|
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
48
|
|
|
* If the qualified name of the supplied element is wrong |
49
|
|
|
*/ |
50
|
|
|
public static function fromXML(DOMElement $xml): static |
51
|
|
|
{ |
52
|
|
|
Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); |
|
|
|
|
53
|
|
|
Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); |
54
|
|
|
|
55
|
|
|
return new static($xml->textContent, self::getAttributesNSFromXML($xml)); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Convert this element to XML. |
61
|
|
|
* |
62
|
|
|
* @param \DOMElement|null $parent The element we should append this element to. |
63
|
|
|
* @return \DOMElement |
64
|
|
|
*/ |
65
|
|
|
public function toXML(?DOMElement $parent = null): DOMElement |
66
|
|
|
{ |
67
|
|
|
$e = $this->instantiateParentElement($parent); |
68
|
|
|
$e->textContent = $this->getContent(); |
69
|
|
|
|
70
|
|
|
foreach ($this->getAttributesNS() as $attr) { |
71
|
|
|
$attr->toXML($e); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
return $e; |
75
|
|
|
} |
76
|
|
|
} |
77
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths