Skip to content

Commit 6502abd

Browse files
committed
Merge branch 'release-7.x' into feature/dom-migration-php84
2 parents e978aca + 7fc52a2 commit 6502abd

36 files changed

Lines changed: 116 additions & 108 deletions

src/Configuration/IdentityProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use SimpleSAML\XMLSecurity\Constants as C;
99

1010
use function array_filter;
11-
use function array_pop;
11+
use function array_last;
1212
use function count;
1313
use function sprintf;
1414

@@ -94,7 +94,7 @@ public function getPrivateKey(string $name, ?bool $required = null)
9494
return null;
9595
}
9696

97-
return array_pop($key);
97+
return array_last($key);
9898
}
9999

100100

src/Configuration/ServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use SimpleSAML\XMLSecurity\Constants as C;
99

1010
use function array_filter;
11-
use function array_pop;
11+
use function array_last;
1212
use function count;
1313
use function sprintf;
1414

@@ -102,7 +102,7 @@ public function getPrivateKey(string $name, ?bool $required = null)
102102
return null;
103103
}
104104

105-
return array_pop($key);
105+
return array_last($key);
106106
}
107107

108108

src/XML/IdentifierTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use SimpleSAML\SAML2\XML\saml\NameID;
1313
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
1414

15-
use function array_pop;
15+
use function array_last;
1616

1717
/**
1818
* Trait grouping common functionality for elements that can hold identifiers.
@@ -94,7 +94,7 @@ protected static function getIdentifierFromXML(Dom\Element $xml): ?IdentifierInt
9494
TooManyElementsException::class,
9595
);
9696

97-
$identifier = array_pop($identifiers);
97+
$identifier = array_last($identifiers);
9898

9999
return $identifier;
100100
}

src/XML/SignedElementTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use SimpleSAML\XMLSecurity\XML\ds\Signature;
1212
use SimpleSAML\XMLSecurity\XML\SignedElementTrait as BaseSignedElementTrait;
1313

14+
use function array_last;
15+
1416
/**
1517
* Helper trait for processing signed elements.
1618
*
@@ -37,7 +39,7 @@ protected function setSignature(Signature $signature): void
3739
$references = $signature->getSignedInfo()->getReferences();
3840
Assert::count($references, 1, "A signature needs to have exactly one Reference, %d found.");
3941

40-
$reference = array_pop($references);
42+
$reference = array_last($references);
4143
Assert::notNull($reference->getURI(), "URI attribute not found.", ReferenceValidationFailedException::class);
4244
Assert::startsWith(
4345
$reference->getURI()->getValue(),

src/XML/ecp/Request.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
2020
use SimpleSAML\XMLSchema\Type\BooleanValue;
2121

22+
use function array_last;
2223
use function intval;
2324
use function strval;
2425

@@ -140,8 +141,8 @@ public static function fromXML(Dom\Element $xml): static
140141
$idpList = IDPList::getChildrenOfClass($xml);
141142

142143
return new static(
143-
array_pop($issuer),
144-
array_pop($idpList),
144+
array_last($issuer),
145+
array_last($idpList),
145146
self::getOptionalAttribute($xml, 'ProviderName', SAMLStringValue::class, null),
146147
self::getOptionalAttribute($xml, 'IsPassive', BooleanValue::class, null),
147148
);

src/XML/ecp/SubjectConfirmation.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use SimpleSAML\XMLSchema\Exception\MissingAttributeException;
1818
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
1919

20+
use function array_last;
21+
2022
/**
2123
* Class representing the ECP SubjectConfirmation element.
2224
*
@@ -113,7 +115,7 @@ public static function fromXML(Dom\Element $xml): static
113115

114116
return new static(
115117
self::getAttribute($xml, 'Method', SAMLAnyURIValue::class),
116-
array_pop($subjectConfirmationData),
118+
array_last($subjectConfirmationData),
117119
);
118120
}
119121

src/XML/emd/RepublishRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException;
1515
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
1616

17-
use function array_pop;
17+
use function array_last;
1818

1919
/**
2020
* Class implementing RepublishRequest.
@@ -71,7 +71,7 @@ public static function fromXML(Dom\Element $xml): static
7171
SchemaViolationException::class,
7272
);
7373

74-
return new static(array_pop($republishTarget));
74+
return new static(array_last($republishTarget));
7575
}
7676

7777

src/XML/md/AbstractRoleDescriptor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
use SimpleSAML\XMLSchema\Type\IDValue;
2525
use SimpleSAML\XMLSchema\Type\QNameValue;
2626

27-
use function array_pop;
27+
use function array_last;
2828

2929
/**
3030
* Class representing a SAML2 RoleDescriptor element.
@@ -148,10 +148,10 @@ public static function fromXML(Dom\Element $xml): static
148148
self::getOptionalAttribute($xml, 'ID', IDValue::class, null),
149149
self::getOptionalAttribute($xml, 'validUntil', SAMLDateTimeValue::class, null),
150150
self::getOptionalAttribute($xml, 'cacheDuration', DurationValue::class, null),
151-
array_pop($extensions),
151+
array_last($extensions),
152152
self::getOptionalAttribute($xml, 'errorURL', SAMLAnyURIValue::class, null),
153153
KeyDescriptor::getChildrenOfClass($xml),
154-
array_pop($orgs),
154+
array_last($orgs),
155155
ContactPerson::getChildrenOfClass($xml),
156156
self::getAttributesNSFromXML($xml),
157157
);

src/XML/md/ContactPerson.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
use function array_filter;
2424
use function array_key_exists;
2525
use function array_keys;
26+
use function array_last;
2627
use function array_map;
27-
use function array_pop;
2828
use function count;
2929

3030
/**
@@ -191,9 +191,9 @@ public static function fromXML(Dom\Element $xml): static
191191

192192
return new static(
193193
$contactType,
194-
array_pop($company),
195-
array_pop($givenName),
196-
array_pop($surName),
194+
array_last($company),
195+
array_last($givenName),
196+
array_last($surName),
197197
(count($extensions) === 1) ? $extensions[0] : null,
198198
$email,
199199
$telephone,

src/XML/md/KeyDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use SimpleSAML\XMLSchema\Exception\TooManyElementsException;
1616
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
1717

18-
use function array_pop;
18+
use function array_last;
1919

2020
/**
2121
* Class representing a KeyDescriptor element.
@@ -97,7 +97,7 @@ public static function fromXML(Dom\Element $xml): static
9797
Assert::maxCount($keyInfo, 1, 'Too many ds:KeyInfo in the KeyDescriptor.', TooManyElementsException::class);
9898

9999
return new static(
100-
array_pop($keyInfo),
100+
array_last($keyInfo),
101101
self::getOptionalAttribute($xml, 'use', KeyTypesValue::class, null),
102102
EncryptionMethod::getChildrenOfClass($xml),
103103
);

0 commit comments

Comments
 (0)