diff --git a/src/XML/SerializableElementTrait.php b/src/XML/SerializableElementTrait.php index 68467685..acba336f 100644 --- a/src/XML/SerializableElementTrait.php +++ b/src/XML/SerializableElementTrait.php @@ -7,7 +7,7 @@ use DOMElement; use SimpleSAML\XML\DOMDocumentFactory; -use function array_pop; +use function array_last; use function get_object_vars; /** @@ -73,7 +73,7 @@ public function __serialize(): array public function __unserialize(array $serialized): void { $xml = static::fromXML( - DOMDocumentFactory::fromString(array_pop($serialized))->documentElement, + DOMDocumentFactory::fromString(array_last($serialized))->documentElement, ); $vars = get_object_vars($xml); diff --git a/src/XMLSchema/XML/AbstractNoFixedFacet.php b/src/XMLSchema/XML/AbstractNoFixedFacet.php index 9828b9a2..a9b9d290 100644 --- a/src/XMLSchema/XML/AbstractNoFixedFacet.php +++ b/src/XMLSchema/XML/AbstractNoFixedFacet.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface; use SimpleSAML\XMLSchema\Type\StringValue; -use function array_pop; +use function array_last; /** * Abstract class representing the facet-type. @@ -58,7 +58,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', StringValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/AbstractNumFacet.php b/src/XMLSchema/XML/AbstractNumFacet.php index 50fb85fe..4065f631 100644 --- a/src/XMLSchema/XML/AbstractNumFacet.php +++ b/src/XMLSchema/XML/AbstractNumFacet.php @@ -13,6 +13,8 @@ use SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface; use SimpleSAML\XMLSchema\Type\NonNegativeIntegerValue; +use function array_last; + /** * Abstract class representing the facet-type. * @@ -62,7 +64,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', NonNegativeIntegerValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/All.php b/src/XMLSchema/XML/All.php index 81143d54..06dd42c8 100644 --- a/src/XMLSchema/XML/All.php +++ b/src/XMLSchema/XML/All.php @@ -19,7 +19,7 @@ use SimpleSAML\XMLSchema\XML\Interface\ParticleInterface; use SimpleSAML\XMLSchema\XML\Interface\TypeDefParticleInterface; -use function array_pop; +use function array_last; /** * Class representing the all-element. @@ -69,7 +69,7 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'minCount', MinOccursValue::class, null), self::getOptionalAttribute($xml, 'maxCount', MaxOccursValue::class, null), $narrowMaxMin, - annotation: array_pop($annotation), + annotation: array_last($annotation), id: self::getOptionalAttribute($xml, 'id', IDValue::class, null), namespacedAttributes: self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Any.php b/src/XMLSchema/XML/Any.php index 853e73df..9f515e66 100644 --- a/src/XMLSchema/XML/Any.php +++ b/src/XMLSchema/XML/Any.php @@ -18,7 +18,7 @@ use SimpleSAML\XMLSchema\XML\Interface\NestedParticleInterface; use SimpleSAML\XMLSchema\XML\Trait\OccursTrait; -use function array_pop; +use function array_last; use function strval; /** @@ -97,7 +97,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getOptionalAttribute($xml, 'namespace', NamespaceListValue::class, null), self::getOptionalAttribute($xml, 'processContents', ProcessContentsValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), self::getOptionalAttribute($xml, 'minOccurs', MinOccursValue::class, null), diff --git a/src/XMLSchema/XML/AnyAttribute.php b/src/XMLSchema/XML/AnyAttribute.php index 57c50a0b..28f3ba4e 100644 --- a/src/XMLSchema/XML/AnyAttribute.php +++ b/src/XMLSchema/XML/AnyAttribute.php @@ -14,7 +14,7 @@ use SimpleSAML\XMLSchema\Type\Schema\NamespaceListValue; use SimpleSAML\XMLSchema\Type\Schema\ProcessContentsValue; -use function array_pop; +use function array_last; /** * Class representing the anyAttribute element @@ -49,7 +49,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getOptionalAttribute($xml, 'namespace', NamespaceListValue::class, null), self::getOptionalAttribute($xml, 'processContents', ProcessContentsValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Choice.php b/src/XMLSchema/XML/Choice.php index 6d7fa60d..6b54fff0 100644 --- a/src/XMLSchema/XML/Choice.php +++ b/src/XMLSchema/XML/Choice.php @@ -19,8 +19,8 @@ use SimpleSAML\XMLSchema\XML\Interface\NestedParticleInterface; use SimpleSAML\XMLSchema\XML\Interface\TypeDefParticleInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the choice-element. @@ -74,7 +74,7 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'minOccurs', MinOccursValue::class, null), self::getOptionalAttribute($xml, 'maxOccurs', MaxOccursValue::class, null), $particles, - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/ComplexContent.php b/src/XMLSchema/XML/ComplexContent.php index 7cf6c032..d4681d10 100644 --- a/src/XMLSchema/XML/ComplexContent.php +++ b/src/XMLSchema/XML/ComplexContent.php @@ -13,6 +13,7 @@ use SimpleSAML\XMLSchema\Type\BooleanValue; use SimpleSAML\XMLSchema\Type\IDValue; +use function array_last; use function array_merge; use function strval; @@ -131,7 +132,7 @@ public static function fromXML(DOMElement $xml): static return new static( $content[0], self::getOptionalAttribute($xml, 'mixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/ComplexRestriction.php b/src/XMLSchema/XML/ComplexRestriction.php index 376653dd..78f25c98 100644 --- a/src/XMLSchema/XML/ComplexRestriction.php +++ b/src/XMLSchema/XML/ComplexRestriction.php @@ -11,8 +11,8 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the complexRestrictionType restriction-element. @@ -65,10 +65,10 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'base', QNameValue::class), - array_pop($particles), + array_last($particles), $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Extension.php b/src/XMLSchema/XML/Extension.php index 0ba00834..8360bb0c 100644 --- a/src/XMLSchema/XML/Extension.php +++ b/src/XMLSchema/XML/Extension.php @@ -11,8 +11,8 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the local version of xs:extension. @@ -65,10 +65,10 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'base', QNameValue::class), - array_pop($particles), + array_last($particles), $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Field.php b/src/XMLSchema/XML/Field.php index e8a646e4..a674fbd7 100644 --- a/src/XMLSchema/XML/Field.php +++ b/src/XMLSchema/XML/Field.php @@ -14,6 +14,7 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\StringValue; +use function array_last; use function strval; /** @@ -106,7 +107,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'xpath', StringValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Import.php b/src/XMLSchema/XML/Import.php index 015ee7fe..a1cd8da4 100644 --- a/src/XMLSchema/XML/Import.php +++ b/src/XMLSchema/XML/Import.php @@ -13,6 +13,7 @@ use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\IDValue; +use function array_last; use function strval; /** @@ -112,7 +113,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getOptionalAttribute($xml, 'namespace', AnyURIValue::class, null), self::getOptionalAttribute($xml, 'schemaLocation', AnyURIValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Key.php b/src/XMLSchema/XML/Key.php index f9c2f5c8..991e1a6c 100644 --- a/src/XMLSchema/XML/Key.php +++ b/src/XMLSchema/XML/Key.php @@ -14,6 +14,8 @@ use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\XML\Interface\IdentityConstraintInterface; +use function array_last; + /** * Class representing the key-element. * @@ -75,7 +77,7 @@ public static function fromXML(DOMElement $xml): static self::getAttribute($xml, 'name', NCNameValue::class), $selector[0], $field, - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Keyref.php b/src/XMLSchema/XML/Keyref.php index a49cdd40..c1941efa 100644 --- a/src/XMLSchema/XML/Keyref.php +++ b/src/XMLSchema/XML/Keyref.php @@ -15,6 +15,7 @@ use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSchema\XML\Interface\IdentityConstraintInterface; +use function array_last; use function strval; /** @@ -107,7 +108,7 @@ public static function fromXML(DOMElement $xml): static self::getAttribute($xml, 'name', NCNameValue::class), $selector[0], $field, - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/LocalAttribute.php b/src/XMLSchema/XML/LocalAttribute.php index 4ef30b12..63338daa 100644 --- a/src/XMLSchema/XML/LocalAttribute.php +++ b/src/XMLSchema/XML/LocalAttribute.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\Schema\UseValue; use SimpleSAML\XMLSchema\Type\StringValue; -use function array_pop; +use function array_last; /** * Class representing the attribute-element. @@ -55,8 +55,8 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'default', StringValue::class, null), self::getOptionalAttribute($xml, 'fixed', StringValue::class, null), self::getOptionalAttribute($xml, 'form', FormChoiceValue::class, null), - array_pop($simpleType), - array_pop($annotation), + array_last($simpleType), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/LocalComplexType.php b/src/XMLSchema/XML/LocalComplexType.php index f9281bd7..1a0697e0 100644 --- a/src/XMLSchema/XML/LocalComplexType.php +++ b/src/XMLSchema/XML/LocalComplexType.php @@ -14,8 +14,8 @@ use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\Schema\DerivationSetValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the xs:complexType element. @@ -90,11 +90,11 @@ public static function fromXML(DOMElement $xml): static return new static( self::getOptionalAttribute($xml, 'mixed', BooleanValue::class, null), - array_pop($content), - array_pop($particles), + array_last($content), + array_last($particles), $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/LocalElement.php b/src/XMLSchema/XML/LocalElement.php index 8b27eab6..78b3e6b0 100644 --- a/src/XMLSchema/XML/LocalElement.php +++ b/src/XMLSchema/XML/LocalElement.php @@ -19,8 +19,8 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\NestedParticleInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the local element-element. @@ -74,7 +74,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getOptionalAttribute($xml, 'name', NCNameValue::class, null), self::getOptionalAttribute($xml, 'ref', QNameValue::class, null), - array_pop($localType), + array_last($localType), $identityConstraint, self::getOptionalAttribute($xml, 'type', QNameValue::class, null), self::getOptionalAttribute($xml, 'minOccurs', MinOccursValue::class, null), @@ -84,7 +84,7 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'nillable', BooleanValue::class, null), self::getOptionalAttribute($xml, 'block', BlockSetValue::class, null), self::getOptionalAttribute($xml, 'form', FormChoiceValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/LocalSimpleType.php b/src/XMLSchema/XML/LocalSimpleType.php index c48acf0b..6de3bcec 100644 --- a/src/XMLSchema/XML/LocalSimpleType.php +++ b/src/XMLSchema/XML/LocalSimpleType.php @@ -14,8 +14,8 @@ use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\Schema\SimpleDerivationSetValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the abstract simpleType. @@ -60,7 +60,7 @@ public static function fromXML(DOMElement $xml): static return new static( $derivation[0], - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/MaxExclusive.php b/src/XMLSchema/XML/MaxExclusive.php index 3161fbbf..75a1cb78 100644 --- a/src/XMLSchema/XML/MaxExclusive.php +++ b/src/XMLSchema/XML/MaxExclusive.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\FacetInterface; -use function array_pop; +use function array_last; /** * Class representing the maxExclusive element @@ -50,7 +50,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', StringValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/MaxInclusive.php b/src/XMLSchema/XML/MaxInclusive.php index bc8402f8..3568800f 100644 --- a/src/XMLSchema/XML/MaxInclusive.php +++ b/src/XMLSchema/XML/MaxInclusive.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\FacetInterface; -use function array_pop; +use function array_last; /** * Class representing the maxInclusive element @@ -50,7 +50,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', StringValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/MinExclusive.php b/src/XMLSchema/XML/MinExclusive.php index 47e7e7ae..5265fb4e 100644 --- a/src/XMLSchema/XML/MinExclusive.php +++ b/src/XMLSchema/XML/MinExclusive.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\FacetInterface; -use function array_pop; +use function array_last; /** * Class representing the minExclusive element @@ -50,7 +50,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', StringValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/MinInclusive.php b/src/XMLSchema/XML/MinInclusive.php index 7dbfa268..05ac27c5 100644 --- a/src/XMLSchema/XML/MinInclusive.php +++ b/src/XMLSchema/XML/MinInclusive.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\FacetInterface; -use function array_pop; +use function array_last; /** * Class representing the minInclusive element @@ -50,7 +50,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', StringValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/NamedAttributeGroup.php b/src/XMLSchema/XML/NamedAttributeGroup.php index 960b7566..d5bcc5f8 100644 --- a/src/XMLSchema/XML/NamedAttributeGroup.php +++ b/src/XMLSchema/XML/NamedAttributeGroup.php @@ -16,8 +16,8 @@ use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSchema\XML\Interface\RedefinableInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the attributeGroup-element. @@ -64,8 +64,8 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'name', NCNameValue::class), $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/NamedGroup.php b/src/XMLSchema/XML/NamedGroup.php index 376d441a..ea2265f1 100644 --- a/src/XMLSchema/XML/NamedGroup.php +++ b/src/XMLSchema/XML/NamedGroup.php @@ -18,8 +18,8 @@ use SimpleSAML\XMLSchema\Type\Schema\MinOccursValue; use SimpleSAML\XMLSchema\XML\Interface\RedefinableInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the group-element. @@ -78,7 +78,7 @@ public static function fromXML(DOMElement $xml): static return new static( $particle[0], name: self::getAttribute($xml, 'name', NCNameValue::class), - annotation: array_pop($annotation), + annotation: array_last($annotation), id: self::getOptionalAttribute($xml, 'id', IDValue::class, null), namespacedAttributes: self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/NarrowMaxMinElement.php b/src/XMLSchema/XML/NarrowMaxMinElement.php index 2ebfa288..de599be1 100644 --- a/src/XMLSchema/XML/NarrowMaxMinElement.php +++ b/src/XMLSchema/XML/NarrowMaxMinElement.php @@ -19,8 +19,8 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\NestedParticleInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the local narrowMaxMin-element. @@ -74,7 +74,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getOptionalAttribute($xml, 'name', NCNameValue::class, null), self::getOptionalAttribute($xml, 'ref', QNameValue::class, null), - array_pop($localType), + array_last($localType), $identityConstraint, self::getOptionalAttribute($xml, 'type', QNameValue::class, null), self::getOptionalAttribute($xml, 'minOccurs', MinOccursValue::class, null), @@ -84,7 +84,7 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'nillable', BooleanValue::class, null), self::getOptionalAttribute($xml, 'block', BlockSetValue::class, null), self::getOptionalAttribute($xml, 'form', FormChoiceValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Notation.php b/src/XMLSchema/XML/Notation.php index d59754b4..ba1ffebc 100644 --- a/src/XMLSchema/XML/Notation.php +++ b/src/XMLSchema/XML/Notation.php @@ -16,6 +16,7 @@ use SimpleSAML\XMLSchema\Type\Schema\PublicValue; use SimpleSAML\XMLSchema\XML\Interface\SchemaTopInterface; +use function array_last; use function strval; /** @@ -133,7 +134,7 @@ public static function fromXML(DOMElement $xml): static self::getAttribute($xml, 'name', NCNameValue::class), self::getOptionalAttribute($xml, 'public', PublicValue::class, null), self::getOptionalAttribute($xml, 'system', AnyURIValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/ReferencedAttributeGroup.php b/src/XMLSchema/XML/ReferencedAttributeGroup.php index 779e515b..ee289581 100644 --- a/src/XMLSchema/XML/ReferencedAttributeGroup.php +++ b/src/XMLSchema/XML/ReferencedAttributeGroup.php @@ -12,7 +12,7 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\QNameValue; -use function array_pop; +use function array_last; /** * Class representing the attributeGroup-element. @@ -47,7 +47,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'ref', QNameValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/ReferencedGroup.php b/src/XMLSchema/XML/ReferencedGroup.php index 84d991df..9de4437e 100644 --- a/src/XMLSchema/XML/ReferencedGroup.php +++ b/src/XMLSchema/XML/ReferencedGroup.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\XML\Interface\NestedParticleInterface; use SimpleSAML\XMLSchema\XML\Interface\TypeDefParticleInterface; -use function array_pop; +use function array_last; /** * Class representing the group-element. @@ -52,7 +52,7 @@ public static function fromXML(DOMElement $xml): static return new static( reference: self::getAttribute($xml, 'ref', QNameValue::class), - annotation: array_pop($annotation), + annotation: array_last($annotation), id: self::getOptionalAttribute($xml, 'id', IDValue::class, null), namespacedAttributes: self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Restriction.php b/src/XMLSchema/XML/Restriction.php index 0ea36675..502ec960 100644 --- a/src/XMLSchema/XML/Restriction.php +++ b/src/XMLSchema/XML/Restriction.php @@ -15,6 +15,7 @@ use SimpleSAML\XMLSchema\XML\Interface\SimpleDerivationInterface; use SimpleSAML\XMLSchema\XML\Trait\SimpleRestrictionModelTrait; +use function array_last; use function array_merge; use function is_null; use function strval; @@ -155,10 +156,10 @@ public static function fromXML(DOMElement $xml): static ); return new static( - array_pop($simpleType), + array_last($simpleType), $facets, self::getOptionalAttribute($xml, 'base', QNameValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Selector.php b/src/XMLSchema/XML/Selector.php index feb2b024..ba930dc0 100644 --- a/src/XMLSchema/XML/Selector.php +++ b/src/XMLSchema/XML/Selector.php @@ -14,6 +14,7 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\StringValue; +use function array_last; use function strval; /** @@ -104,7 +105,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'xpath', StringValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Sequence.php b/src/XMLSchema/XML/Sequence.php index 514de94c..ce0e6ca7 100644 --- a/src/XMLSchema/XML/Sequence.php +++ b/src/XMLSchema/XML/Sequence.php @@ -19,8 +19,8 @@ use SimpleSAML\XMLSchema\XML\Interface\NestedParticleInterface; use SimpleSAML\XMLSchema\XML\Interface\TypeDefParticleInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the sequence-element. @@ -74,7 +74,7 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'minOccurs', MinOccursValue::class, null), self::getOptionalAttribute($xml, 'maxOccurs', MaxOccursValue::class, null), $particles, - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/SimpleChoice.php b/src/XMLSchema/XML/SimpleChoice.php index d2df95cf..2beb734b 100644 --- a/src/XMLSchema/XML/SimpleChoice.php +++ b/src/XMLSchema/XML/SimpleChoice.php @@ -15,8 +15,8 @@ use SimpleSAML\XMLSchema\Type\Schema\MaxOccursValue; use SimpleSAML\XMLSchema\Type\Schema\MinOccursValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the choice-element. @@ -69,7 +69,7 @@ public static function fromXML(DOMElement $xml): static return new static( nestedParticles: $particles, - annotation: array_pop($annotation), + annotation: array_last($annotation), id: self::getOptionalAttribute($xml, 'id', IDValue::class, null), namespacedAttributes: self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/SimpleContent.php b/src/XMLSchema/XML/SimpleContent.php index 1fdd7ab6..05576bd8 100644 --- a/src/XMLSchema/XML/SimpleContent.php +++ b/src/XMLSchema/XML/SimpleContent.php @@ -12,6 +12,7 @@ use SimpleSAML\XMLSchema\Exception\TooManyElementsException; use SimpleSAML\XMLSchema\Type\IDValue; +use function array_last; use function array_merge; /** @@ -111,7 +112,7 @@ public static function fromXML(DOMElement $xml): static return new static( $content[0], - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/SimpleExtension.php b/src/XMLSchema/XML/SimpleExtension.php index 416c7901..27fca427 100644 --- a/src/XMLSchema/XML/SimpleExtension.php +++ b/src/XMLSchema/XML/SimpleExtension.php @@ -11,8 +11,8 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the simple version of the xs:extension. @@ -51,8 +51,8 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'base', QNameValue::class), $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/SimpleRestriction.php b/src/XMLSchema/XML/SimpleRestriction.php index 38699aa5..bd11f9fe 100644 --- a/src/XMLSchema/XML/SimpleRestriction.php +++ b/src/XMLSchema/XML/SimpleRestriction.php @@ -11,8 +11,8 @@ use SimpleSAML\XMLSchema\Type\IDValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the simple version of the xs:restriction. @@ -81,11 +81,11 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'base', QNameValue::class), - array_pop($localSimpleType), + array_last($localSimpleType), $facets, $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/SimpleSequence.php b/src/XMLSchema/XML/SimpleSequence.php index d4997cc0..79e1d429 100644 --- a/src/XMLSchema/XML/SimpleSequence.php +++ b/src/XMLSchema/XML/SimpleSequence.php @@ -13,8 +13,8 @@ use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\Type\QNameValue; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the sequence-element. @@ -67,7 +67,7 @@ public static function fromXML(DOMElement $xml): static return new static( nestedParticles: $particles, - annotation: array_pop($annotation), + annotation: array_last($annotation), id: self::getOptionalAttribute($xml, 'id', IDValue::class, null), namespacedAttributes: self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/TopLevelAttribute.php b/src/XMLSchema/XML/TopLevelAttribute.php index fb4a0c06..fecf90f0 100644 --- a/src/XMLSchema/XML/TopLevelAttribute.php +++ b/src/XMLSchema/XML/TopLevelAttribute.php @@ -19,7 +19,7 @@ use SimpleSAML\XMLSchema\Type\StringValue; use SimpleSAML\XMLSchema\XML\Interface\SchemaTopInterface; -use function array_pop; +use function array_last; /** * Class representing the attribute-element. @@ -71,8 +71,8 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'type', QNameValue::class, null), self::getOptionalAttribute($xml, 'default', StringValue::class, null), self::getOptionalAttribute($xml, 'fixed', StringValue::class, null), - array_pop($simpleType), - array_pop($annotation), + array_last($simpleType), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/TopLevelComplexType.php b/src/XMLSchema/XML/TopLevelComplexType.php index 0698900e..0d9290a5 100644 --- a/src/XMLSchema/XML/TopLevelComplexType.php +++ b/src/XMLSchema/XML/TopLevelComplexType.php @@ -16,8 +16,8 @@ use SimpleSAML\XMLSchema\Type\Schema\DerivationSetValue; use SimpleSAML\XMLSchema\XML\Interface\RedefinableInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the xs:complexType element. @@ -88,11 +88,11 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'abstract', BooleanValue::class, null), self::getOptionalAttribute($xml, 'final', DerivationSetValue::class, null), self::getOptionalAttribute($xml, 'block', DerivationSetValue::class, null), - array_pop($content), - array_pop($particles), + array_last($content), + array_last($particles), $attributes, - array_pop($anyAttribute), - array_pop($annotation), + array_last($anyAttribute), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/TopLevelElement.php b/src/XMLSchema/XML/TopLevelElement.php index c9074b1b..85635811 100644 --- a/src/XMLSchema/XML/TopLevelElement.php +++ b/src/XMLSchema/XML/TopLevelElement.php @@ -22,6 +22,8 @@ use SimpleSAML\XMLSchema\Type\Schema\MinOccursValue; use SimpleSAML\XMLSchema\Type\StringValue; +use function array_last; + /** * Class representing the topLevelElement-type. * @@ -84,7 +86,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'name', NCNameValue::class), - array_pop($localType), + array_last($localType), $identityConstraint, self::getOptionalAttribute($xml, 'type', QNameValue::class, null), self::getOptionalAttribute($xml, 'substitutionGroup', QNameValue::class, null), @@ -94,7 +96,7 @@ public static function fromXML(DOMElement $xml): static self::getOptionalAttribute($xml, 'abstract', BooleanValue::class, null), self::getOptionalAttribute($xml, 'final', DerivationSetValue::class, null), self::getOptionalAttribute($xml, 'block', BlockSetValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/TopLevelSimpleType.php b/src/XMLSchema/XML/TopLevelSimpleType.php index 9d4fbe77..87c64a08 100644 --- a/src/XMLSchema/XML/TopLevelSimpleType.php +++ b/src/XMLSchema/XML/TopLevelSimpleType.php @@ -16,8 +16,8 @@ use SimpleSAML\XMLSchema\Type\Schema\SimpleDerivationSetValue; use SimpleSAML\XMLSchema\XML\Interface\RedefinableInterface; +use function array_last; use function array_merge; -use function array_pop; /** * Class representing the abstract simpleType. @@ -63,7 +63,7 @@ public static function fromXML(DOMElement $xml): static $derivation[0], self::getAttribute($xml, 'name', NCNameValue::class), self::getOptionalAttribute($xml, 'final', SimpleDerivationSetValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/TotalDigits.php b/src/XMLSchema/XML/TotalDigits.php index 0f1efbe1..443cf858 100644 --- a/src/XMLSchema/XML/TotalDigits.php +++ b/src/XMLSchema/XML/TotalDigits.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\PositiveIntegerValue; use SimpleSAML\XMLSchema\XML\Interface\FacetInterface; -use function array_pop; +use function array_last; /** * Class representing the totalDigits element @@ -50,7 +50,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', PositiveIntegerValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Union.php b/src/XMLSchema/XML/Union.php index 45461209..00c40066 100644 --- a/src/XMLSchema/XML/Union.php +++ b/src/XMLSchema/XML/Union.php @@ -19,8 +19,8 @@ use SimpleSAML\XMLSchema\XML\Interface\SimpleDerivationInterface; use function array_fill; +use function array_last; use function array_map; -use function array_pop; use function implode; use function strval; @@ -144,7 +144,7 @@ public static function fromXML(DOMElement $xml): static return new static( LocalSimpleType::getChildrenOfClass($xml), $memberTypes, - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/Unique.php b/src/XMLSchema/XML/Unique.php index 3a9db1ea..1ae1e732 100644 --- a/src/XMLSchema/XML/Unique.php +++ b/src/XMLSchema/XML/Unique.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\NCNameValue; use SimpleSAML\XMLSchema\XML\Interface\IdentityConstraintInterface; -use function array_pop; +use function array_last; /** * Class representing the unique-element. @@ -79,7 +79,7 @@ public static function fromXML(DOMElement $xml): static self::getAttribute($xml, 'name', NCNameValue::class), $selector[0], $field, - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/WhiteSpace.php b/src/XMLSchema/XML/WhiteSpace.php index a643eb75..acf69d43 100644 --- a/src/XMLSchema/XML/WhiteSpace.php +++ b/src/XMLSchema/XML/WhiteSpace.php @@ -15,7 +15,7 @@ use SimpleSAML\XMLSchema\Type\Schema\WhiteSpaceValue; use SimpleSAML\XMLSchema\XML\Interface\FacetInterface; -use function array_pop; +use function array_last; /** * Class representing the whiteSpace element @@ -70,7 +70,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'value', WhiteSpaceValue::class), self::getOptionalAttribute($xml, 'fixed', BooleanValue::class, null), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/XsInclude.php b/src/XMLSchema/XML/XsInclude.php index e5af555b..6d2ab277 100644 --- a/src/XMLSchema/XML/XsInclude.php +++ b/src/XMLSchema/XML/XsInclude.php @@ -13,6 +13,7 @@ use SimpleSAML\XMLSchema\Type\AnyURIValue; use SimpleSAML\XMLSchema\Type\IDValue; +use function array_last; use function strval; /** @@ -91,7 +92,7 @@ public static function fromXML(DOMElement $xml): static return new static( self::getAttribute($xml, 'schemaLocation', AnyURIValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XMLSchema/XML/XsList.php b/src/XMLSchema/XML/XsList.php index fa815b8c..b0739944 100644 --- a/src/XMLSchema/XML/XsList.php +++ b/src/XMLSchema/XML/XsList.php @@ -14,6 +14,7 @@ use SimpleSAML\XMLSchema\Type\QNameValue; use SimpleSAML\XMLSchema\XML\Interface\SimpleDerivationInterface; +use function array_last; use function strval; /** @@ -114,9 +115,9 @@ public static function fromXML(DOMElement $xml): static Assert::maxCount($simpleType, 1, TooManyElementsException::class); return new static( - array_pop($simpleType), + array_last($simpleType), self::getOptionalAttribute($xml, 'itemType', QNameValue::class), - array_pop($annotation), + array_last($annotation), self::getOptionalAttribute($xml, 'id', IDValue::class, null), self::getAttributesNSFromXML($xml), );