1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SimpleSAML\XMLSecurity\XML\xenc; |
6
|
|
|
|
7
|
|
|
use DOMElement; |
8
|
|
|
use SimpleSAML\Assert\Assert; |
9
|
|
|
use SimpleSAML\XML\Exception\SchemaViolationException; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Class representing a xenc:KeySize element. |
13
|
|
|
* |
14
|
|
|
* @package simplesaml/xml-security |
15
|
|
|
* @psalm-suppress PropertyNotSetInConstructor $content |
16
|
|
|
*/ |
17
|
|
|
final class KeySize extends AbstractXencElement |
18
|
|
|
{ |
19
|
|
|
/** @var int */ |
20
|
|
|
protected int $keySize; |
21
|
|
|
|
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @param int $keySize |
25
|
|
|
*/ |
26
|
|
|
public function __construct(int $keySize) |
27
|
|
|
{ |
28
|
|
|
$this->setKeySize($keySize); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @param int $keySize |
34
|
|
|
*/ |
35
|
|
|
protected function setKeySize(int $keySize): void |
36
|
|
|
{ |
37
|
|
|
Assert::positiveInteger($keySize, SchemaViolationException::class); |
38
|
|
|
$this->keySize = $keySize; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @return int |
44
|
|
|
*/ |
45
|
|
|
public function getKeySize(): int |
46
|
|
|
{ |
47
|
|
|
return $this->keySize; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Convert XML into a class instance |
53
|
|
|
* |
54
|
|
|
* @param \DOMElement $xml The XML element we should load |
55
|
|
|
* @return static |
56
|
|
|
* |
57
|
|
|
* @throws \SimpleSAML\XML\Exception\InvalidDOMElementException |
58
|
|
|
* If the qualified name of the supplied element is wrong |
59
|
|
|
*/ |
60
|
|
|
public static function fromXML(DOMElement $xml): static |
61
|
|
|
{ |
62
|
|
|
Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); |
|
|
|
|
63
|
|
|
Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); |
64
|
|
|
Assert::numeric($xml->textContent); |
65
|
|
|
|
66
|
|
|
return new static(intval($xml->textContent)); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Convert this element to XML. |
72
|
|
|
* |
73
|
|
|
* @param \DOMElement|null $parent The element we should append this element to. |
74
|
|
|
* @return \DOMElement |
75
|
|
|
*/ |
76
|
|
|
public function toXML(DOMElement $parent = null): DOMElement |
77
|
|
|
{ |
78
|
|
|
$e = $this->instantiateParentElement($parent); |
79
|
|
|
$e->textContent = strval($this->getKeySize()); |
80
|
|
|
|
81
|
|
|
return $e; |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|
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