Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/XML/ds/AbstractDSAKeyValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* A class implementing the ds:AbstractDSAKeyValueType element.
Expand Down Expand Up @@ -177,13 +177,13 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($pgenCounter, 1, TooManyElementsException::class);

return new static(
array_pop($y),
array_pop($g),
array_pop($j),
array_pop($p),
array_pop($q),
array_pop($seed),
array_pop($pgenCounter),
array_last($y),
array_last($g),
array_last($j),
array_last($p),
array_last($q),
array_last($seed),
array_last($pgenCounter),
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/XML/ds/AbstractPGPDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use SimpleSAML\XMLSchema\XML\Constants\NS;
use SimpleSAML\XMLSecurity\XML\ds\AbstractDsElement;

use function array_pop;
use function array_last;

/**
* Abstract class representing the PGPDataType.
Expand Down Expand Up @@ -95,8 +95,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($pgpKeyPacket, 1, TooManyElementsException::class);

return new static(
array_pop($pgpKeyId),
array_pop($pgpKeyPacket),
array_last($pgpKeyId),
array_last($pgpKeyPacket),
self::getChildElementsFromXML($xml),
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/XML/ds/KeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use SimpleSAML\XMLSecurity\Constants as C;
use SimpleSAML\XMLSecurity\XML\dsig11\ECKeyValue;

use function array_last;
use function array_merge;
use function array_pop;

/**
* Class representing a ds:KeyValue element.
Expand Down Expand Up @@ -107,7 +107,7 @@ public static function fromXML(DOMElement $xml): static
TooManyElementsException::class,
);

return new static(array_pop($keyValue));
return new static(array_last($keyValue));
}


Expand Down
4 changes: 3 additions & 1 deletion src/XML/ds/RSAKeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_last;

/**
* Class representing a ds:RSAKeyValue element.
*
Expand Down Expand Up @@ -98,7 +100,7 @@ public static function fromXML(DOMElement $xml): static
TooManyElementsException::class,
);

return new static(array_pop($modulus), array_pop($exponent));
return new static(array_last($modulus), array_last($exponent));
}


Expand Down
8 changes: 4 additions & 4 deletions src/XML/ds/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use SimpleSAML\XMLSchema\Type\IDValue;
use SimpleSAML\XMLSecurity\Assert\Assert;

use function array_pop;
use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -153,9 +153,9 @@ public static function fromXML(DOMElement $xml): static
);

return new static(
array_pop($digestMethod),
array_pop($digestValue),
empty($transforms) ? null : array_pop($transforms),
array_last($digestMethod),
array_last($digestValue),
empty($transforms) ? null : array_last($transforms),
$Id,
$Type,
$URI,
Expand Down
3 changes: 2 additions & 1 deletion src/XML/ds/RetrievalMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
use SimpleSAML\XMLSchema\Type\AnyURIValue;

use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -91,7 +92,7 @@ public static function fromXML(DOMElement $xml): static
);

return new static(
array_pop($transforms),
array_last($transforms),
$URI,
$Type,
);
Expand Down
8 changes: 4 additions & 4 deletions src/XML/ds/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use SimpleSAML\XMLSecurity\Assert\Assert;
use SimpleSAML\XMLSecurity\Constants as C;

use function array_pop;
use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -149,9 +149,9 @@ public static function fromXML(DOMElement $xml): static
$objects = DsObject::getChildrenOfClass($xml);

return new static(
array_pop($signedInfo),
array_pop($signatureValue),
empty($keyInfo) ? null : array_pop($keyInfo),
array_last($signedInfo),
array_last($signatureValue),
empty($keyInfo) ? null : array_last($keyInfo),
$objects,
self::getOptionalAttribute($xml, 'Id', IDValue::class, null),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XML/ds/SignatureMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;

use function array_keys;
use function array_last;
use function array_merge;
use function array_pop;
use function strval;

/**
Expand Down Expand Up @@ -102,7 +102,7 @@ public static function fromXML(DOMElement $xml): static
$hmacOutputLength = HMACOutputLength::getChildrenOfClass($xml);
Assert::maxCount($hmacOutputLength, 1, TooManyElementsException::class);

return new static($Algorithm, array_pop($hmacOutputLength), self::getChildElementsFromXML($xml));
return new static($Algorithm, array_last($hmacOutputLength), self::getChildElementsFromXML($xml));
}


Expand Down
6 changes: 3 additions & 3 deletions src/XML/ds/SignedInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use SimpleSAML\XMLSecurity\XML\CanonicalizableElementInterface;
use SimpleSAML\XMLSecurity\XML\CanonicalizableElementTrait;

use function array_pop;
use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -162,8 +162,8 @@ public static function fromXML(DOMElement $xml): static
);

$signedInfo = new static(
array_pop($canonicalizationMethod),
array_pop($signatureMethod),
array_last($canonicalizationMethod),
array_last($signatureMethod),
$references,
self::getOptionalAttribute($xml, 'Id', IDValue::class, null),
);
Expand Down
6 changes: 3 additions & 3 deletions src/XML/ds/Transform.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use SimpleSAML\XMLSecurity\XML\ec\InclusiveNamespaces;
use SimpleSAML\XPath\Constants as XPATH_C;

use function array_pop;
use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -121,8 +121,8 @@ public static function fromXML(DOMElement $xml): static

return new static(
self::getAttribute($xml, 'Algorithm', AnyURIValue::class),
array_pop($xpath),
array_pop($prefixes),
array_last($xpath),
array_last($prefixes),
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/XML/ds/X509IssuerSerial.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a ds:X509IssuerSerial element.
Expand Down Expand Up @@ -77,8 +77,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($serial, 1, TooManyElementsException::class);

return new static(
array_pop($issuer),
array_pop($serial),
array_last($issuer),
array_last($serial),
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/XML/dsig11/Curve.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:Curve element.
Expand Down Expand Up @@ -41,8 +41,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($b, 1, TooManyElementsException::class);

return new static(
array_pop($a),
array_pop($b),
array_last($a),
array_last($b),
);
}
}
8 changes: 4 additions & 4 deletions src/XML/dsig11/ECKeyValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
use SimpleSAML\XMLSchema\Type\IDValue;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:ECKeyValue element.
Expand Down Expand Up @@ -49,10 +49,10 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($namedCurve, 1, TooManyElementsException::class);

return new static(
array_pop($publicKey),
array_last($publicKey),
self::getOptionalAttribute($xml, 'Id', IDValue::class, null),
array_pop($ecParameters),
array_pop($namedCurve),
array_last($ecParameters),
array_last($namedCurve),
);
}
}
14 changes: 7 additions & 7 deletions src/XML/dsig11/ECParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:ECParameters element.
Expand Down Expand Up @@ -55,12 +55,12 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($validationData, 1, TooManyElementsException::class);

return new static(
array_pop($fieldId),
array_pop($curve),
array_pop($base),
array_pop($order),
array_pop($coFactor),
array_pop($validationData),
array_last($fieldId),
array_last($curve),
array_last($base),
array_last($order),
array_last($coFactor),
array_last($validationData),
);
}
}
4 changes: 3 additions & 1 deletion src/XML/dsig11/FieldID.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_last;

/**
* Class representing a dsig11:FieldID element.
*
Expand Down Expand Up @@ -50,7 +52,7 @@ public static function fromXML(DOMElement $xml): static
);

return new static(
array_pop($fieldId),
array_last($fieldId),
);
}
}
4 changes: 2 additions & 2 deletions src/XML/dsig11/GnB.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:GnB element.
Expand Down Expand Up @@ -42,7 +42,7 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($m, 1, TooManyElementsException::class);

return new static(
array_pop($m),
array_last($m),
);
}
}
10 changes: 5 additions & 5 deletions src/XML/dsig11/PnB.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:PnB element.
Expand Down Expand Up @@ -54,10 +54,10 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($m, 1, TooManyElementsException::class);

return new static(
array_pop($m),
array_pop($k1),
array_pop($k2),
array_pop($k3),
array_last($m),
array_last($k1),
array_last($k2),
array_last($k3),
);
}
}
4 changes: 2 additions & 2 deletions src/XML/dsig11/Prime.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:Prime element.
Expand Down Expand Up @@ -42,7 +42,7 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($p, 1, TooManyElementsException::class);

return new static(
array_pop($p),
array_last($p),
);
}
}
6 changes: 3 additions & 3 deletions src/XML/dsig11/TnB.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use SimpleSAML\XMLSchema\Exception\MissingElementException;
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;

use function array_pop;
use function array_last;

/**
* Class representing a dsig11:TnB element.
Expand Down Expand Up @@ -46,8 +46,8 @@ public static function fromXML(DOMElement $xml): static
Assert::maxCount($m, 1, TooManyElementsException::class);

return new static(
array_pop($m),
array_pop($k),
array_last($m),
array_last($k),
);
}
}
Loading