Skip to content

Commit 18f451a

Browse files
committed
Explicit nullable type
1 parent c7072b4 commit 18f451a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+43
-43
lines changed

src/Utils/XML.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class XML
3333
public static function canonicalizeData(
3434
DOMElement $element,
3535
string $c14nMethod,
36-
array $xpaths = null,
37-
array $prefixes = null,
36+
?array $xpaths = null,
37+
?array $prefixes = null,
3838
): string {
3939
$withComments = match ($c14nMethod) {
4040
C::C14N_EXCLUSIVE_WITH_COMMENTS, C::C14N_INCLUSIVE_WITH_COMMENTS => true,

src/XML/EncryptedElementTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public static function fromXML(DOMElement $xml): static
179179
/**
180180
* @inheritDoc
181181
*/
182-
public function toXML(DOMElement $parent = null): DOMElement
182+
public function toXML(?DOMElement $parent = null): DOMElement
183183
{
184184
$e = $this->instantiateParentElement($parent);
185185
$this->encryptedData->toXML($e);
@@ -196,7 +196,7 @@ public function toXML(DOMElement $parent = null): DOMElement
196196
* @param \DOMElement|null $parent The element we should append to.
197197
* @return \DOMElement
198198
*/
199-
abstract public function instantiateParentElement(DOMElement $parent = null): DOMElement;
199+
abstract public function instantiateParentElement(?DOMElement $parent = null): DOMElement;
200200

201201

202202
/**

src/XML/SignedElementInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ public function isSigned(): bool;
6565
* in the signature.
6666
* @throws \SimpleSAML\XMLSecurity\Exception\RuntimeException if the signature fails to validate.
6767
*/
68-
public function verify(SignatureAlgorithmInterface $verifier = null): SignedElementInterface;
68+
public function verify(?SignatureAlgorithmInterface $verifier = null): SignedElementInterface;
6969
}

src/XML/ds/AbstractKeyInfoType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function getInfo(): array
100100
* @param \DOMElement|null $parent The element we should append this KeyInfo to.
101101
* @return \DOMElement
102102
*/
103-
public function toXML(DOMElement $parent = null): DOMElement
103+
public function toXML(?DOMElement $parent = null): DOMElement
104104
{
105105
$e = $this->instantiateParentElement($parent);
106106

src/XML/ds/CanonicalizationMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static function fromXML(DOMElement $xml): static
7878
* @param \DOMElement|null $parent The element we should append this KeyName element to.
7979
* @return \DOMElement
8080
*/
81-
public function toXML(DOMElement $parent = null): DOMElement
81+
public function toXML(?DOMElement $parent = null): DOMElement
8282
{
8383
$e = $this->instantiateParentElement($parent);
8484
$e->setAttribute('Algorithm', $this->getAlgorithm());

src/XML/ds/DigestMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function fromXML(DOMElement $xml): static
8484
* @param \DOMElement|null $parent The element we should append this DigestMethod element to.
8585
* @return \DOMElement
8686
*/
87-
public function toXML(DOMElement $parent = null): DOMElement
87+
public function toXML(?DOMElement $parent = null): DOMElement
8888
{
8989
$e = $this->instantiateParentElement($parent);
9090
$e->setAttribute('Algorithm', $this->getAlgorithm());

src/XML/ds/DsObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static function fromXML(DOMElement $xml): static
123123
* @param \DOMElement|null $parent The element we should append this ds:Object element to.
124124
* @return \DOMElement
125125
*/
126-
public function toXML(DOMElement $parent = null): DOMElement
126+
public function toXML(?DOMElement $parent = null): DOMElement
127127
{
128128
$e = $this->instantiateParentElement($parent);
129129

src/XML/ds/KeyValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static function fromXML(DOMElement $xml): static
100100
* @param \DOMElement|null $parent The element we should append this KeyValue element to.
101101
* @return \DOMElement
102102
*/
103-
public function toXML(DOMElement $parent = null): DOMElement
103+
public function toXML(?DOMElement $parent = null): DOMElement
104104
{
105105
$e = $this->instantiateParentElement($parent);
106106

src/XML/ds/Manifest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static function fromXML(DOMElement $xml): static
8888
* @param \DOMElement|null $parent The element we should append this Manifest element to.
8989
* @return \DOMElement
9090
*/
91-
public function toXML(DOMElement $parent = null): DOMElement
91+
public function toXML(?DOMElement $parent = null): DOMElement
9292
{
9393
$e = $this->instantiateParentElement($parent);
9494

src/XML/ds/RSAKeyValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static function fromXML(DOMElement $xml): static
104104
* @param \DOMElement|null $parent The element we should append this RSAKeyValue element to.
105105
* @return \DOMElement
106106
*/
107-
public function toXML(DOMElement $parent = null): DOMElement
107+
public function toXML(?DOMElement $parent = null): DOMElement
108108
{
109109
$e = $this->instantiateParentElement($parent);
110110

0 commit comments

Comments
 (0)