Skip to content

Commit

Permalink
Explicit nullable type
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Dec 1, 2024
1 parent c7072b4 commit 9d4e206
Show file tree
Hide file tree
Showing 40 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/Utils/XML.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class XML
public static function canonicalizeData(
DOMElement $element,
string $c14nMethod,
array $xpaths = null,
array $prefixes = null,
?array $xpaths = null,
?array $prefixes = null,
): string {
$withComments = match ($c14nMethod) {
C::C14N_EXCLUSIVE_WITH_COMMENTS, C::C14N_INCLUSIVE_WITH_COMMENTS => true,
Expand Down
4 changes: 2 additions & 2 deletions src/XML/EncryptedElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$this->encryptedData->toXML($e);
Expand All @@ -196,7 +196,7 @@ public function toXML(DOMElement $parent = null): DOMElement
* @param \DOMElement|null $parent The element we should append to.
* @return \DOMElement
*/
abstract public function instantiateParentElement(DOMElement $parent = null): DOMElement;
abstract public function instantiateParentElement(?DOMElement $parent = null): DOMElement;


/**
Expand Down
2 changes: 1 addition & 1 deletion src/XML/SignedElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ public function isSigned(): bool;
* in the signature.
* @throws \SimpleSAML\XMLSecurity\Exception\RuntimeException if the signature fails to validate.
*/
public function verify(SignatureAlgorithmInterface $verifier = null): SignedElementInterface;
public function verify(?SignatureAlgorithmInterface $verifier = null): SignedElementInterface;
}
2 changes: 1 addition & 1 deletion src/XML/ds/AbstractKeyInfoType.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function getInfo(): array
* @param \DOMElement|null $parent The element we should append this KeyInfo to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/CanonicalizationMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this KeyName element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Algorithm', $this->getAlgorithm());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/DigestMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this DigestMethod element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Algorithm', $this->getAlgorithm());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/DsObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this ds:Object element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/KeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this KeyValue element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/Manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this Manifest element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/RSAKeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this RSAKeyValue element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this Reference element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
if ($this->getId() !== null) {
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/RetrievalMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this RetrievalMethod element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('URI', $this->getURI());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this Signature element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/SignatureMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this SignatureMethod element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Algorithm', $this->getAlgorithm());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/SignatureProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this SignatureProperties element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/SignatureProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this SignatureProperty element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Target', $this->getTarget());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/SignatureValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this SignatureValue element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent();
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/SignedInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this SignedInfo element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/Transform.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this Transform element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/Transforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this Transforms element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/X509Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this X509Data element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/X509IssuerSerial.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this X509IssuerSerial element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/X509SerialNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this X509SerialNumber element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent();
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/XPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function fromXML(DOMElement $xml): static
* @param DOMElement|null $parent
* @return DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getExpression();
Expand Down
2 changes: 1 addition & 1 deletion src/XML/dsig11/KeyInfoReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this KeyInfoReference element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('URI', $this->getURI());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/dsig11/X509Digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this X509Digest element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent();
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ec/InclusiveNamespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this InclusiveNamespaces to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractAgreementMethodType.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this AgreementMethod to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Algorithm', $this->getAlgorithm());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractDHKeyValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this DHKeyValue to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractEncryptedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function getType(): ?string
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractEncryptionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this EncryptionMethod to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Algorithm', $this->getAlgorithm());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractEncryptionPropertiesType.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractEncryptionPropertyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/AbstractReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('URI', $this->getUri());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/CipherData.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/CipherReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('URI', $this->getUri());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/EncryptedKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = parent::toXML($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/KeySize.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = strval($this->getKeySize());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/ReferenceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/xenc/Transforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this Transforms element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down

0 comments on commit 9d4e206

Please sign in to comment.