|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace SimpleSAML\WSSecurity\XML\wsa_200508; |
|
6
|
|
|
|
|
7
|
|
|
use DOMElement; |
|
8
|
|
|
use SimpleSAML\Assert\Assert; |
|
9
|
|
|
use SimpleSAML\XML\Exception\InvalidDOMElementException; |
|
10
|
|
|
use SimpleSAML\XML\Exception\SchemaViolationException; |
|
11
|
|
|
use SimpleSAML\XML\ExtendableAttributesTrait; |
|
12
|
|
|
use SimpleSAML\XML\URIElementTrait; |
|
13
|
|
|
use SimpleSAML\XML\XsNamespace as NS; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Class representing a wsa:RelatesTo element. |
|
17
|
|
|
* |
|
18
|
|
|
* @package simplesamlphp/ws-security |
|
19
|
|
|
*/ |
|
20
|
|
|
final class RelatesTo extends AbstractWsaElement |
|
21
|
|
|
{ |
|
22
|
|
|
use ExtendableAttributesTrait; |
|
23
|
|
|
use URIElementTrait; |
|
24
|
|
|
|
|
25
|
|
|
/** The namespace-attribute for the xs:anyAttribute element */ |
|
26
|
|
|
public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; |
|
27
|
|
|
|
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Initialize a wsa:RelatesTo |
|
31
|
|
|
* |
|
32
|
|
|
* @param string $content |
|
33
|
|
|
* @param string|null $RelationshipType |
|
34
|
|
|
* @param list<\SimpleSAML\XML\Attribute> $namespacedAttributes |
|
|
|
|
|
|
35
|
|
|
*/ |
|
36
|
|
|
public function __construct( |
|
37
|
|
|
string $content, |
|
38
|
|
|
protected ?string $RelationshipType = 'http://www.w3.org/2005/08/addressing/reply', |
|
39
|
|
|
array $namespacedAttributes = [], |
|
40
|
|
|
) { |
|
41
|
|
|
Assert::nullOrValidURI($RelationshipType, SchemaViolationException::class); |
|
42
|
|
|
|
|
43
|
|
|
$this->setContent($content); |
|
44
|
|
|
$this->setAttributesNS($namespacedAttributes); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Collect the value of the RelationshipType property. |
|
50
|
|
|
* |
|
51
|
|
|
* @return string|null |
|
52
|
|
|
*/ |
|
53
|
|
|
public function getRelationshipType(): ?string |
|
54
|
|
|
{ |
|
55
|
|
|
return $this->RelationshipType; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
/* |
|
60
|
|
|
* Convert XML into an RelatesTo element |
|
61
|
|
|
* |
|
62
|
|
|
* @param \DOMElement $xml The XML element we should load |
|
63
|
|
|
* @return static |
|
64
|
|
|
* |
|
65
|
|
|
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
|
66
|
|
|
* If the qualified name of the supplied element is wrong |
|
67
|
|
|
*/ |
|
68
|
|
|
public static function fromXML(DOMElement $xml): static |
|
69
|
|
|
{ |
|
70
|
|
|
Assert::same($xml->localName, 'RelatesTo', InvalidDOMElementException::class); |
|
71
|
|
|
Assert::same($xml->namespaceURI, RelatesTo::NS, InvalidDOMElementException::class); |
|
72
|
|
|
|
|
73
|
|
|
return new static( |
|
74
|
|
|
$xml->textContent, |
|
75
|
|
|
self::getOptionalAttribute($xml, 'RelationshipType', null), |
|
76
|
|
|
self::getAttributesNSFromXML($xml), |
|
77
|
|
|
); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* Convert this RelatesTo to XML. |
|
83
|
|
|
* |
|
84
|
|
|
* @param \DOMElement|null $parent The element we should add this RelatesTo to. |
|
85
|
|
|
* @return \DOMElement This Header-element. |
|
86
|
|
|
*/ |
|
87
|
|
|
public function toXML(?DOMElement $parent = null): DOMElement |
|
88
|
|
|
{ |
|
89
|
|
|
$e = $this->instantiateParentElement($parent); |
|
90
|
|
|
$e->textContent = $this->getContent(); |
|
91
|
|
|
|
|
92
|
|
|
if ($this->getRelationshipType() !== null) { |
|
93
|
|
|
$e->setAttribute('RelationshipType', $this->getRelationshipType()); |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
foreach ($this->getAttributesNS() as $attr) { |
|
97
|
|
|
$attr->toXML($e); |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
return $e; |
|
101
|
|
|
} |
|
102
|
|
|
} |
|
103
|
|
|
|
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