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
18 changes: 9 additions & 9 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']
php-version: ['8.3', '8.4', '8.5']

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
with:
php-version: ${{ matrix.php-version }}

Expand All @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false

uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.6
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0
with:
enable_eslinter: false
enable_jsonlinter: true
Expand All @@ -45,15 +45,15 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Setup PHP, with composer and extensions
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, filter, libxml, pcre, spl, xml, xmlreader
extensions: ctype, date, dom, filter, intl, libxml, pcre, sodium, spl, xml, xmlreader
tools: composer
ini-values: error_reporting=E_ALL
coverage: pcov
Expand Down Expand Up @@ -107,15 +107,15 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.2', '8.3', '8.4', '8.5']
php-versions: ['8.3', '8.4', '8.5']

steps:
- name: Setup PHP, with composer and extensions
# https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype, date, dom, filter, libxml, pcre, spl, xml, xmlreader
extensions: ctype, date, dom, filter, intl, libxml, pcre, sodium, spl, xml, xmlreader
tools: composer
ini-values: error_reporting=E_ALL
coverage: none
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.5'
tools: composer, composer-require-checker, composer-unused
extensions: ctype, date, dom, filter, libxml, pcre, spl, xml
extensions: ctype, date, dom, filter, intl, libxml, pcre, sodium, spl, xml
coverage: none

- name: Setup problem matchers for PHP
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the lowest supported version
php-version: '8.2'
php-version: '8.3'
extensions: ctype, date, dom, filter, libxml, pcre, spl, xml
tools: composer
coverage: none
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
},
"require": {
"php": "^8.2",
"php": "^8.3",

"ext-bcmath": "*",
"ext-date": "*",
Expand All @@ -47,7 +47,7 @@
"simplesamlphp/composer-xmlprovider-installer": "~1.2"
},
"require-dev": {
"simplesamlphp/simplesamlphp-test-framework": "~1.10"
"simplesamlphp/simplesamlphp-test-framework": "~1.11"
},
"support": {
"issues": "https://github.com/simplesamlphp/xml-common/issues",
Expand Down
17 changes: 3 additions & 14 deletions src/XML/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
*
* @package simplesamlphp/xml-common
*/
abstract class AbstractElement implements SerializableElementInterface
abstract class AbstractElement implements
SerializableElementInterface,
ElementInterface
{
use SerializableElementTrait;

Expand All @@ -34,7 +36,6 @@ abstract class AbstractElement implements SerializableElementInterface
* Create a document structure for this element
*
* @param \DOMElement|null $parent The element we should append to.
* @return \DOMElement
*/
public function instantiateParentElement(?DOMElement $parent = null): DOMElement
{
Expand Down Expand Up @@ -117,7 +118,6 @@ public static function getOptionalAttribute(
* Static method that processes a fully namespaced class name and returns the name of the class from it.
*
* @param string $class
* @return string
*/
public static function getClassName(string $class): string
{
Expand All @@ -129,8 +129,6 @@ public static function getClassName(string $class): string

/**
* Get the XML qualified name (prefix:name) of the element represented by this class.
*
* @return string
*/
public function getQualifiedName(): string
{
Expand Down Expand Up @@ -166,8 +164,6 @@ public static function getChildrenOfClass(DOMElement $parent): array

/**
* Get the namespace for the element.
*
* @return string|null
*/
public static function getNamespaceURI(): ?string
{
Expand All @@ -187,8 +183,6 @@ public static function getNamespaceURI(): ?string

/**
* Get the namespace-prefix for the element.
*
* @return string
*/
public static function getNamespacePrefix(): string
{
Expand All @@ -206,8 +200,6 @@ public static function getNamespacePrefix(): string

/**
* Get the local name for the element.
*
* @return string
*/
public static function getLocalName(): string
{
Expand All @@ -224,8 +216,6 @@ public static function getLocalName(): string

/**
* Whether the element may be normalized.
*
* @return bool
*/
public static function getNormalization(): bool
{
Expand All @@ -244,7 +234,6 @@ public static function getNormalization(): bool
* Test if an object, at the state it's in, would produce an empty XML-element
*
* @codeCoverageIgnore
* @return bool
*/
public function isEmptyElement(): bool
{
Expand Down
1 change: 0 additions & 1 deletion src/XML/ArrayizableElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface ArrayizableElementInterface
* Create a class from an array
*
* @param array<string, mixed> $data
* @return static
*/
public static function fromArray(array $data): static;

Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/ByteTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait ByteTrait
{
/** @var string */
private static string $byte_regex = '/^
(
(
Expand Down
2 changes: 0 additions & 2 deletions src/XML/Assert/DateTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ trait DateTimeTrait
* * ss is a two-integer-digit numeral that represents the whole seconds;
* * '.' s+ (if present) represents the fractional seconds;
* * zzzzzz (if present) represents the timezone (as described below).
*
* @var string
*/
private static string $datetime_regex = '/^
-?
Expand Down
2 changes: 0 additions & 2 deletions src/XML/Assert/DateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ trait DateTrait
*
* and the least upper bound of the interval is the timeline point represented (noncanonically) by:
* '-' yyyy '-' mm '-' dd 'T24:00:00' zzzzzz?.
*
* @var string
*/
private static string $date_regex = '/^
-?
Expand Down
2 changes: 0 additions & 2 deletions src/XML/Assert/DayTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ trait DayTrait
{
/**
* Format: ---DD with optional timezone representation
*
* @var string
*/
private static string $day_regex = '/^
---
Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/DecimalTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait DecimalTrait
{
/** @var string */
private static string $decimal_regex = '/^[+-]?((\d+(\.\d*)?)|(\.\d+))$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/DoubleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait DoubleTrait
{
/** @var string */
private static string $double_regex = '/^
(
([+-]?([0-9]+[.][0-9]*|[.][0-9]+)([e][+-]?[0-9]+)?)
Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/DurationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait DurationTrait
{
/** @var string */
private static string $duration_regex = '/^
([-+]?)
P
Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/EntitiesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait EntitiesTrait
{
/** @var string */
private static string $entities_regex = '/^([a-z_][\w.-]*)([\s][a-z_][\w.-]*)*$/Dui';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/FloatTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait FloatTrait
{
/** @var string */
private static string $float_regex = '/^(([+-]?([0-9]+[.][0-9]*|[.][0-9]+)([e][+-]?[0-9]+)?)|NaN|[-]?FIN)$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/HexBinaryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait HexBinaryTrait
{
/** @var string */
private static string $hexbin_regex = '/^([0-9a-f]{2})+$/Di';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/IDRefsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait IDRefsTrait
{
/** @var string */
private static string $idrefs_regex = '/^([a-z_][\w.-]*)([\s][a-z_][\w.-]*)*$/Dui';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/IntTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait IntTrait
{
/** @var string */
private static string $int_regex = '/^
(
(
Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/IntegerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait IntegerTrait
{
/** @var string */
private static string $integer_regex = '/^[+-]?(\d+)$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/LanguageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait LanguageTrait
{
/** @var string */
private static string $language_regex = '/^([a-z]{2}|[i]-[a-z]+|[x]-[a-z]{1,8})(-[a-z]{1,8})*$/Di';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/LongTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait LongTrait
{
/** @var string */
private static string $long_regex = '/^
(
([-+]?[0]*)?
Expand Down
2 changes: 0 additions & 2 deletions src/XML/Assert/MonthTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ trait MonthTrait
{
/**
* Format --MM with optional timezone representation
*
* @var string
*/
private static string $month_regex = '/^--(0[1-9]|1[012])((\+|-)([0-1][0-9]|2[0-4]):(0[0-9]|[1-5][0-9])|Z)?$/D';

Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NCNameTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NCNameTrait
{
/** @var string */
private static string $ncname_regex = '/^[a-z_][\w.-]*$/Dui';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NMTokenTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NMTokenTrait
{
/** @var string */
private static string $nmtoken_regex = '/^[\w.:-]+$/Du';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NMTokensTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NMTokensTrait
{
/** @var string */
private static string $nmtokens_regex = '/^([\w.:-]+)([\s][\w.:-]+)*$/Du';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NameTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NameTrait
{
/** @var string */
private static string $name_regex = '/^[a-z:-][\w.:-]+$/Dui';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NegativeIntegerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NegativeIntegerTrait
{
/** @var string */
private static string $negativeInteger_regex = '/^(-\d+)$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NonNegativeIntegerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NonNegativeIntegerTrait
{
/** @var string */
private static string $nonNegativeInteger_regex = '/^([+]?\d+)$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/NonPositiveIntegerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait NonPositiveIntegerTrait
{
/** @var string */
private static string $nonPositiveInteger_regex = '/^(-\d+|0)$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/PositiveIntegerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait PositiveIntegerTrait
{
/** @var string */
private static string $positiveInteger_regex = '/^([+]?0*)([1-9]\d*$)$/D';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/QNameTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait QNameTrait
{
/** @var string */
private static string $qname_regex = '/^([a-z_][\w.-]*)(:[a-z_][\w.-]*)?$/Di';


Expand Down
1 change: 0 additions & 1 deletion src/XML/Assert/ShortTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
trait ShortTrait
{
/** @var string */
private static string $short_regex = '/^
(
(
Expand Down
Loading