1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\SOAP\XML\env_200106; |
6
|
|
|
|
7
|
|
|
use DOMElement; |
8
|
|
|
use SimpleSAML\Assert\Assert; |
9
|
|
|
use SimpleSAML\XML\Exception\InvalidDOMElementException; |
10
|
|
|
use SimpleSAML\XML\ExtendableAttributesTrait; |
11
|
|
|
use SimpleSAML\XML\ExtendableElementTrait; |
12
|
|
|
use SimpleSAML\XML\SchemaValidatableElementInterface; |
13
|
|
|
use SimpleSAML\XML\SchemaValidatableElementTrait; |
14
|
|
|
use SimpleSAML\XML\XsNamespace as NS; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Class representing a env:Header element. |
18
|
|
|
* |
19
|
|
|
* @package simplesaml/xml-soap |
20
|
|
|
*/ |
21
|
|
|
final class Header extends AbstractSoapElement implements SchemaValidatableElementInterface |
22
|
|
|
{ |
23
|
|
|
use ExtendableAttributesTrait; |
24
|
|
|
use ExtendableElementTrait; |
25
|
|
|
use SchemaValidatableElementTrait; |
26
|
|
|
|
27
|
|
|
/** The namespace-attribute for the xs:any element */ |
28
|
|
|
public const XS_ANY_ELT_NAMESPACE = NS::OTHER; |
29
|
|
|
|
30
|
|
|
/** The namespace-attribute for the xs:anyAttribute element */ |
31
|
|
|
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Initialize a env:Header |
36
|
|
|
* |
37
|
|
|
* @param list<\SimpleSAML\XML\SerializableElementInterface> $children |
38
|
|
|
* @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes |
|
|
|
|
39
|
|
|
*/ |
40
|
|
|
public function __construct(array $children = [], array $namespacedAttributes = []) |
41
|
|
|
{ |
42
|
|
|
$this->setElements($children); |
43
|
|
|
$this->setAttributesNS($namespacedAttributes); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Test if an object, at the state it's in, would produce an empty XML-element |
49
|
|
|
* |
50
|
|
|
* @return bool |
51
|
|
|
*/ |
52
|
|
|
public function isEmptyElement(): bool |
53
|
|
|
{ |
54
|
|
|
return empty($this->elements) && empty($this->namespacedAttributes); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
/* |
59
|
|
|
* Convert XML into an Header element |
60
|
|
|
* |
61
|
|
|
* @param \DOMElement $xml The XML element we should load |
62
|
|
|
* @return static |
63
|
|
|
* |
64
|
|
|
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
65
|
|
|
* If the qualified name of the supplied element is wrong |
66
|
|
|
*/ |
67
|
|
|
public static function fromXML(DOMElement $xml): static |
68
|
|
|
{ |
69
|
|
|
Assert::same($xml->localName, 'Header', InvalidDOMElementException::class); |
70
|
|
|
Assert::same($xml->namespaceURI, Header::NS, InvalidDOMElementException::class); |
71
|
|
|
|
72
|
|
|
return new static( |
73
|
|
|
self::getChildElementsFromXML($xml), |
74
|
|
|
self::getAttributesNSFromXML($xml), |
75
|
|
|
); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Convert this Header to XML. |
81
|
|
|
* |
82
|
|
|
* @param \DOMElement|null $parent The element we should add this header to. |
83
|
|
|
* @return \DOMElement This Header-element. |
84
|
|
|
*/ |
85
|
|
|
public function toXML(?DOMElement $parent = null): DOMElement |
86
|
|
|
{ |
87
|
|
|
$e = $this->instantiateParentElement($parent); |
88
|
|
|
|
89
|
|
|
foreach ($this->getAttributesNS() as $attr) { |
90
|
|
|
$attr->toXML($e); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** @psalm-var \SimpleSAML\XML\SerializableElementInterface $child */ |
94
|
|
|
foreach ($this->getElements() as $child) { |
95
|
|
|
$child->toXML($e); |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
return $e; |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|
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