1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\SAML2\XML\emd; |
6
|
|
|
|
7
|
|
|
use DOMElement; |
8
|
|
|
use SimpleSAML\Assert\Assert; |
9
|
|
|
use SimpleSAML\XML\Exception\SchemaViolationException; |
10
|
|
|
|
11
|
|
|
use function array_pop; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Class implementing RepublishRequest. |
15
|
|
|
* |
16
|
|
|
* @package simplesamlphp/saml2 |
17
|
|
|
*/ |
18
|
|
|
final class RepublishRequest extends AbstractEmdElement |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @param \SimpleSAML\SAML2\XML\emd\RepublishTarget $republishTarget |
22
|
|
|
*/ |
23
|
|
|
public function __construct( |
24
|
|
|
protected RepublishTarget $republishTarget, |
25
|
|
|
) { |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Collect the value of the RepublishTarget-property |
31
|
|
|
* |
32
|
|
|
* @return \SimpleSAML\SAML2\XML\emd\RepublishTarget |
33
|
|
|
*/ |
34
|
|
|
public function getRepublishTarget(): RepublishTarget |
35
|
|
|
{ |
36
|
|
|
return $this->republishTarget; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Convert XML into a RepublishRequest |
42
|
|
|
* |
43
|
|
|
* @param \DOMElement $xml The XML element we should load |
44
|
|
|
* @return static |
45
|
|
|
* |
46
|
|
|
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
47
|
|
|
* if the qualified name of the supplied element is wrong |
48
|
|
|
* @throws \SimpleSAML\XML\Exception\MissingAttributeException |
49
|
|
|
* if the supplied element is missing one of the mandatory attributes |
50
|
|
|
*/ |
51
|
|
|
public static function fromXML(DOMElement $xml): static |
52
|
|
|
{ |
53
|
|
|
Assert::same($xml->localName, 'RepublishRequest', InvalidDOMElementException::class); |
|
|
|
|
54
|
|
|
Assert::same($xml->namespaceURI, RepublishRequest::NS, InvalidDOMElementException::class); |
55
|
|
|
|
56
|
|
|
$republishTarget = RepublishTarget::getChildrenOfClass($xml); |
57
|
|
|
Assert::count( |
58
|
|
|
$republishTarget, |
59
|
|
|
1, |
60
|
|
|
'A RepublishRequest can contain exactly one RepublishTarget.', |
61
|
|
|
SchemaViolationException::class, |
62
|
|
|
); |
63
|
|
|
|
64
|
|
|
return new static(array_pop($republishTarget)); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Convert this element to XML. |
70
|
|
|
* |
71
|
|
|
* @param \DOMElement|null $parent The element we should append to. |
72
|
|
|
* @return \DOMElement |
73
|
|
|
*/ |
74
|
|
|
public function toXML(DOMElement $parent = null): DOMElement |
75
|
|
|
{ |
76
|
|
|
$e = $this->instantiateParentElement($parent); |
77
|
|
|
|
78
|
|
|
$this->republishTarget->toXML($e); |
79
|
|
|
|
80
|
|
|
return $e; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Create a class from an array |
86
|
|
|
* |
87
|
|
|
* @param array $data |
88
|
|
|
* @return static |
89
|
|
|
*/ |
90
|
|
|
public static function fromArray(array $data): static |
91
|
|
|
{ |
92
|
|
|
Assert::keyExists($data, 'RepublishTarget'); |
93
|
|
|
Assert::string($data['RepublishTarget']); |
94
|
|
|
|
95
|
|
|
return new static(new RepublishTarget($data['RepublishTarget'])); |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Create an array from this class |
101
|
|
|
* |
102
|
|
|
* @return array |
103
|
|
|
*/ |
104
|
|
|
public function toArray(): array |
105
|
|
|
{ |
106
|
|
|
return ['RepublishTarget' => $this->getRepublishTarget()->getContent()]; |
107
|
|
|
} |
108
|
|
|
} |
109
|
|
|
|
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