Skip to content

Commit

Permalink
Merge branch 'master' into feature/ds-missing-elements
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen authored Dec 3, 2024
2 parents b5fed62 + 2f478b2 commit 215c158
Show file tree
Hide file tree
Showing 43 changed files with 51 additions and 51 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.3'
php-version: '8.4'
tools: composer, composer-require-checker, composer-unused, phpcs
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
coverage: none
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Print OpenSSL version
Expand Down Expand Up @@ -187,15 +187,15 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run unit tests with coverage
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
run: vendor/bin/phpunit

- name: Run unit tests (no coverage)
if: ${{ matrix.php-versions != '8.3' }}
if: ${{ matrix.php-versions != '8.4' }}
run: vendor/bin/phpunit --no-coverage

- name: Save coverage data
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data
Expand All @@ -209,7 +209,7 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Print OpenSSL version
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"ext-pcre": "*",
"ext-spl": "*",

"simplesamlphp/assert": "^1.3",
"simplesamlphp/xml-common": "^1.19.0"
"simplesamlphp/assert": "^1.5",
"simplesamlphp/xml-common": "^1.20.0"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "^1.7"
Expand Down
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/SignedElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function isSigned(): bool
* in the signature.
* @throws \SimpleSAML\XMLSecurity\Exception\RuntimeException if the signature fails to verify.
*/
public function verify(SignatureAlgorithmInterface $verifier = null): SignedElementInterface
public function verify(?SignatureAlgorithmInterface $verifier = null): SignedElementInterface
{
if (!$this->isSigned()) {
throw new NoSignatureFoundException();
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ds/AbstractKeyInfoType.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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 @@ -109,7 +109,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 @@ -102,7 +102,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/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
Loading

0 comments on commit 215c158

Please sign in to comment.