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
4 changes: 2 additions & 2 deletions src/XML/SerializableElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use DOMElement;
use SimpleSAML\XML\DOMDocumentFactory;

use function array_pop;
use function array_last;
use function get_object_vars;

/**
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/AbstractNoFixedFacet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 3 additions & 1 deletion src/XMLSchema/XML/AbstractNumFacet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/Any.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/AnyAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/Choice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
3 changes: 2 additions & 1 deletion src/XMLSchema/XML/ComplexContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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),
);
Expand Down
8 changes: 4 additions & 4 deletions src/XMLSchema/XML/ComplexRestriction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
8 changes: 4 additions & 4 deletions src/XMLSchema/XML/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
3 changes: 2 additions & 1 deletion src/XMLSchema/XML/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use SimpleSAML\XMLSchema\Type\IDValue;
use SimpleSAML\XMLSchema\Type\StringValue;

use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -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),
);
Expand Down
3 changes: 2 additions & 1 deletion src/XMLSchema/XML/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use SimpleSAML\XMLSchema\Type\AnyURIValue;
use SimpleSAML\XMLSchema\Type\IDValue;

use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 3 additions & 1 deletion src/XMLSchema/XML/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use SimpleSAML\XMLSchema\Type\NCNameValue;
use SimpleSAML\XMLSchema\XML\Interface\IdentityConstraintInterface;

use function array_last;

/**
* Class representing the key-element.
*
Expand Down Expand Up @@ -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),
);
Expand Down
3 changes: 2 additions & 1 deletion src/XMLSchema/XML/Keyref.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use SimpleSAML\XMLSchema\Type\QNameValue;
use SimpleSAML\XMLSchema\XML\Interface\IdentityConstraintInterface;

use function array_last;
use function strval;

/**
Expand Down Expand Up @@ -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),
);
Expand Down
6 changes: 3 additions & 3 deletions src/XMLSchema/XML/LocalAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
10 changes: 5 additions & 5 deletions src/XMLSchema/XML/LocalComplexType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
6 changes: 3 additions & 3 deletions src/XMLSchema/XML/LocalElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
Expand All @@ -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),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/LocalSimpleType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/MaxExclusive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
);
Expand Down
4 changes: 2 additions & 2 deletions src/XMLSchema/XML/MaxInclusive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
);
Expand Down
Loading