From b321e1756f7767fa27ee8a04a40be6c06e7a098d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Dec 2025 22:21:22 +0100 Subject: [PATCH 1/3] Bump minimum PHP-version --- .github/workflows/php.yml | 12 ++++++------ composer.json | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f0bb073..fafe715 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -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 }} @@ -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 @@ -45,7 +45,7 @@ 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 @@ -107,7 +107,7 @@ 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 @@ -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, pcre, soap, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index 15e06ad..b9b262d 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.2", + "php": "^8.3", "ext-dom": "*", "ext-spl": "*", @@ -18,7 +18,7 @@ "simplesamlphp/xml-common": "~2.4" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.10", + "simplesamlphp/simplesamlphp-test-framework": "~1.11", "simplesamlphp/xml-security": "~2.0" }, "autoload": { From 668deebc65e4e18a1af346dd6d777eca965f3967 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Dec 2025 22:22:52 +0100 Subject: [PATCH 2/3] Add ext-intl + ext-sodium for composer-require-checker --- .github/workflows/php.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index fafe715..fb4c45a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -53,7 +53,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, filter, pcre, soap, spl, xml + extensions: ctype, date, dom, filter, intl, pcre, soap, sodium, spl, xml tools: composer ini-values: error_reporting=E_ALL coverage: pcov @@ -115,7 +115,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, filter, pcre, soap, spl, xml + extensions: ctype, date, dom, filter, intl, pcre, soap, sodium, spl, xml tools: composer ini-values: error_reporting=E_ALL coverage: none @@ -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, phpcs - extensions: ctype, date, dom, filter, pcre, soap, spl, xml + extensions: ctype, date, dom, filter, intl, pcre, soap, sodium, spl, xml coverage: none - name: Setup problem matchers for PHP @@ -216,7 +216,7 @@ jobs: with: # Should be the lowest supported version php-version: '8.3' - extensions: ctype, date, dom, filter, pcre, soap, spl, xml + extensions: ctype, date, dom, filter, intl, pcre, soap, sodium, spl, xml tools: composer coverage: none From e5547ec7733db89c2253c505b89d40b7c34b4e3c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 17 Dec 2025 22:29:10 +0100 Subject: [PATCH 3/3] Typed constants --- src/Assert/DateTimeTrait.php | 2 -- src/Constants.php | 10 ++++++---- src/Type/DateTimeValue.php | 7 ++----- src/XML/wsse/AbstractAttributedString.php | 9 +++------ src/XML/wsse/AbstractBinarySecurityTokenType.php | 2 -- src/XML/wsse/AbstractEmbeddedType.php | 8 ++------ src/XML/wsse/AbstractEncodedString.php | 2 -- src/XML/wsse/AbstractKeyIdentifierType.php | 2 -- src/XML/wsse/AbstractPasswordString.php | 2 -- src/XML/wsse/AbstractReferenceType.php | 4 +--- src/XML/wsse/AbstractSecurityHeaderType.php | 8 ++------ src/XML/wsse/AbstractSecurityTokenReferenceType.php | 11 +++-------- src/XML/wsse/AbstractTransformationParametersType.php | 8 ++------ src/XML/wsse/AbstractUsernameTokenType.php | 10 ++++------ src/XML/wsse/AbstractWsseElement.php | 9 +++------ src/XML/wsu/AbstractAttributedDateTime.php | 4 +--- src/XML/wsu/AbstractAttributedURI.php | 7 ++----- src/XML/wsu/AbstractTimestamp.php | 10 +++------- src/XML/wsu/AbstractWsuElement.php | 9 +++------ 19 files changed, 37 insertions(+), 87 deletions(-) diff --git a/src/Assert/DateTimeTrait.php b/src/Assert/DateTimeTrait.php index bd22089..ff25701 100644 --- a/src/Assert/DateTimeTrait.php +++ b/src/Assert/DateTimeTrait.php @@ -13,8 +13,6 @@ trait DateTimeTrait { /** - * @param string $value - * @param string $message */ protected static function validDateTime(string $value, string $message = ''): void { diff --git a/src/Constants.php b/src/Constants.php index 23e577e..b6c9455 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -15,19 +15,21 @@ class Constants extends \SimpleSAML\XML\Constants /** * The namespace for WS-Security extensions. */ - public const NS_SEC_EXT = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; + public const string NS_SEC_EXT = + 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'; /** * The namespace for WS-Security utilities protocol. */ - public const NS_SEC_UTIL = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; + public const string NS_SEC_UTIL = + 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'; /** */ - public const WSU_TIMESTAMP_FAULT = 'MessageExpired'; + public const string WSU_TIMESTAMP_FAULT = 'MessageExpired'; /** * The format to express a timestamp in WSU */ - public const DATETIME_FORMAT = 'Y-m-d\\TH:i:sp'; + public const string DATETIME_FORMAT = 'Y-m-d\\TH:i:sp'; } diff --git a/src/Type/DateTimeValue.php b/src/Type/DateTimeValue.php index fa3bd60..d3c39bd 100644 --- a/src/Type/DateTimeValue.php +++ b/src/Type/DateTimeValue.php @@ -15,16 +15,13 @@ class DateTimeValue extends BaseDateTimeValue { /** * Lowercase p as opposed to the base-class to covert the timestamp to UTC as required - * by the WSSecurity specifications + * by the WSSecurity specifications */ - public const DATETIME_FORMAT = 'Y-m-d\\TH:i:sp'; + public const string DATETIME_FORMAT = 'Y-m-d\\TH:i:sp'; /** * Validate the value. - * - * @param string $value - * @return void */ protected function validateValue(string $value): void { diff --git a/src/XML/wsse/AbstractAttributedString.php b/src/XML/wsse/AbstractAttributedString.php index 292212d..5fe971c 100644 --- a/src/XML/wsse/AbstractAttributedString.php +++ b/src/XML/wsse/AbstractAttributedString.php @@ -28,15 +28,14 @@ abstract class AbstractAttributedString extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** The exclusions for the xs:anyAttribute element */ - public const XS_ANY_ATTR_EXCLUSIONS = [ + public const array XS_ANY_ATTR_EXCLUSIONS = [ ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd', 'Id'], ]; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; /** @@ -69,7 +68,6 @@ public function getId(): ?IDValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -94,7 +92,6 @@ public static function fromXML(DOMElement $xml): static /** * @param \DOMElement|null $parent - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractBinarySecurityTokenType.php b/src/XML/wsse/AbstractBinarySecurityTokenType.php index 9e64785..d750c16 100644 --- a/src/XML/wsse/AbstractBinarySecurityTokenType.php +++ b/src/XML/wsse/AbstractBinarySecurityTokenType.php @@ -53,7 +53,6 @@ public function getValueType(): ?AnyURIValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -82,7 +81,6 @@ public static function fromXML(DOMElement $xml): static * Add this username token to an XML element. * * @param \DOMElement $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractEmbeddedType.php b/src/XML/wsse/AbstractEmbeddedType.php index 229a92b..d792156 100644 --- a/src/XML/wsse/AbstractEmbeddedType.php +++ b/src/XML/wsse/AbstractEmbeddedType.php @@ -24,10 +24,10 @@ abstract class AbstractEmbeddedType extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** @@ -58,8 +58,6 @@ public function getValueType(): ?AnyURIValue /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -73,7 +71,6 @@ public function isEmptyElement(): bool * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -95,7 +92,6 @@ public static function fromXML(DOMElement $xml): static * Add this username token to an XML element. * * @param \DOMElement|null $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractEncodedString.php b/src/XML/wsse/AbstractEncodedString.php index 9e1f94e..cbac834 100644 --- a/src/XML/wsse/AbstractEncodedString.php +++ b/src/XML/wsse/AbstractEncodedString.php @@ -52,7 +52,6 @@ public function getEncodingType(): ?AnyURIValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -78,7 +77,6 @@ public static function fromXML(DOMElement $xml): static /** * @param \DOMElement|null $parent - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractKeyIdentifierType.php b/src/XML/wsse/AbstractKeyIdentifierType.php index ef43095..8803b51 100644 --- a/src/XML/wsse/AbstractKeyIdentifierType.php +++ b/src/XML/wsse/AbstractKeyIdentifierType.php @@ -52,7 +52,6 @@ public function getValueType(): ?AnyURIValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -81,7 +80,6 @@ public static function fromXML(DOMElement $xml): static * Add this username token to an XML element. * * @param \DOMElement $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractPasswordString.php b/src/XML/wsse/AbstractPasswordString.php index b480277..69a1657 100644 --- a/src/XML/wsse/AbstractPasswordString.php +++ b/src/XML/wsse/AbstractPasswordString.php @@ -51,7 +51,6 @@ public function getType(): ?AnyURIValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -77,7 +76,6 @@ public static function fromXML(DOMElement $xml): static /** * @param \DOMElement|null $parent - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractReferenceType.php b/src/XML/wsse/AbstractReferenceType.php index 4a0c6d1..bac101b 100644 --- a/src/XML/wsse/AbstractReferenceType.php +++ b/src/XML/wsse/AbstractReferenceType.php @@ -22,7 +22,7 @@ abstract class AbstractReferenceType extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** @@ -63,7 +63,6 @@ public function getURI(): ?AnyURIValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -85,7 +84,6 @@ public static function fromXML(DOMElement $xml): static * Add this username token to an XML element. * * @param \DOMElement|null $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractSecurityHeaderType.php b/src/XML/wsse/AbstractSecurityHeaderType.php index ba0e82e..d3abbef 100644 --- a/src/XML/wsse/AbstractSecurityHeaderType.php +++ b/src/XML/wsse/AbstractSecurityHeaderType.php @@ -23,10 +23,10 @@ abstract class AbstractSecurityHeaderType extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::ANY; + public const string XS_ANY_ATTR_NAMESPACE = NS::ANY; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** @@ -46,8 +46,6 @@ final public function __construct( /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -60,7 +58,6 @@ public function isEmptyElement(): bool * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -81,7 +78,6 @@ public static function fromXML(DOMElement $xml): static * Add this SecurityHeaderType token to an XML element. * * @param \DOMElement|null $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractSecurityTokenReferenceType.php b/src/XML/wsse/AbstractSecurityTokenReferenceType.php index f2f94e3..cd0b86b 100644 --- a/src/XML/wsse/AbstractSecurityTokenReferenceType.php +++ b/src/XML/wsse/AbstractSecurityTokenReferenceType.php @@ -30,16 +30,16 @@ abstract class AbstractSecurityTokenReferenceType extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** The exclusions for the xs:anyAttribute element */ - public const XS_ANY_ATTR_EXCLUSIONS = [ + public const array XS_ANY_ATTR_EXCLUSIONS = [ ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd', 'Id'], ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Usage'], ]; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** @@ -73,8 +73,6 @@ public function getId(): ?IDValue /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -89,8 +87,6 @@ public function isEmptyElement(): bool * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static - * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ @@ -122,7 +118,6 @@ public static function fromXML(DOMElement $xml): static * Add this SecurityTokenReferenceType token to an XML element. * * @param \DOMElement|null $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractTransformationParametersType.php b/src/XML/wsse/AbstractTransformationParametersType.php index 5181f5c..45b3fea 100644 --- a/src/XML/wsse/AbstractTransformationParametersType.php +++ b/src/XML/wsse/AbstractTransformationParametersType.php @@ -23,10 +23,10 @@ abstract class AbstractTransformationParametersType extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** @@ -46,8 +46,6 @@ final public function __construct( /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -59,7 +57,6 @@ public function isEmptyElement(): bool * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -80,7 +77,6 @@ public static function fromXML(DOMElement $xml): static * Add this username token to an XML element. * * @param \DOMElement|null $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractUsernameTokenType.php b/src/XML/wsse/AbstractUsernameTokenType.php index 16c1bbf..510cd7b 100644 --- a/src/XML/wsse/AbstractUsernameTokenType.php +++ b/src/XML/wsse/AbstractUsernameTokenType.php @@ -29,18 +29,18 @@ abstract class AbstractUsernameTokenType extends AbstractWsseElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** The exclusions for the xs:anyAttribute element */ - public const XS_ANY_ATTR_EXCLUSIONS = [ + public const array XS_ANY_ATTR_EXCLUSIONS = [ ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd', 'Id'], ]; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** The exclusions for the xs:any element */ - public const XS_ANY_ELT_EXCLUSIONS = [ + public const array XS_ANY_ELT_EXCLUSIONS = [ ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Username'], ]; @@ -86,7 +86,6 @@ public function getUsername(): Username * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -118,7 +117,6 @@ public static function fromXML(DOMElement $xml): static * Add this username token to an XML element. * * @param \DOMElement|null $parent The element we should append this username token to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsse/AbstractWsseElement.php b/src/XML/wsse/AbstractWsseElement.php index 44abdbf..d6a4a61 100644 --- a/src/XML/wsse/AbstractWsseElement.php +++ b/src/XML/wsse/AbstractWsseElement.php @@ -16,12 +16,9 @@ */ abstract class AbstractWsseElement extends AbstractElement { - /** @var string */ - public const NS = C::NS_SEC_EXT; + public const string NS = C::NS_SEC_EXT; - /** @var string */ - public const NS_PREFIX = 'wsse'; + public const string NS_PREFIX = 'wsse'; - /** @var string */ - public const SCHEMA = 'resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd'; + public const string SCHEMA = 'resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd'; } diff --git a/src/XML/wsu/AbstractAttributedDateTime.php b/src/XML/wsu/AbstractAttributedDateTime.php index 3b7202c..ed1aa71 100644 --- a/src/XML/wsu/AbstractAttributedDateTime.php +++ b/src/XML/wsu/AbstractAttributedDateTime.php @@ -23,7 +23,7 @@ abstract class AbstractAttributedDateTime extends AbstractWsuElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** @@ -66,7 +66,6 @@ public function getDateTime(): DateTimeValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -87,7 +86,6 @@ public static function fromXML(DOMElement $xml): static /** * @param \DOMElement|null $parent - * @return \DOMElement */ final public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsu/AbstractAttributedURI.php b/src/XML/wsu/AbstractAttributedURI.php index 89d9d11..00d278c 100644 --- a/src/XML/wsu/AbstractAttributedURI.php +++ b/src/XML/wsu/AbstractAttributedURI.php @@ -24,11 +24,10 @@ abstract class AbstractAttributedURI extends AbstractWsuElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = AnyURIValue::class; + public const string TEXTCONTENT_TYPE = AnyURIValue::class; /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** @@ -63,7 +62,6 @@ public function getId(): ?IDValue * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -84,7 +82,6 @@ public static function fromXML(DOMElement $xml): static /** * @param \DOMElement|null $parent - * @return \DOMElement */ final public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsu/AbstractTimestamp.php b/src/XML/wsu/AbstractTimestamp.php index 6bee72f..12a8ec4 100644 --- a/src/XML/wsu/AbstractTimestamp.php +++ b/src/XML/wsu/AbstractTimestamp.php @@ -26,13 +26,13 @@ abstract class AbstractTimestamp extends AbstractWsuElement /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; + public const string XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** The exclusions for the xs:any element */ - public const XS_ANY_ELT_EXCLUSIONS = [ + public const array XS_ANY_ELT_EXCLUSIONS = [ ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd', 'Created'], ['http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd', 'Expires'], ]; @@ -88,8 +88,6 @@ public function getExpires(): ?Expires /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -105,7 +103,6 @@ public function isEmptyElement(): bool * Create an instance of this object from its XML representation. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -138,7 +135,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Timestamp to XML. * * @param \DOMElement|null $parent The element we should append this class to. - * @return \DOMElement The XML element after adding the data corresponding to this Timestamp. */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/wsu/AbstractWsuElement.php b/src/XML/wsu/AbstractWsuElement.php index 7d4dba5..824f615 100644 --- a/src/XML/wsu/AbstractWsuElement.php +++ b/src/XML/wsu/AbstractWsuElement.php @@ -16,12 +16,9 @@ */ abstract class AbstractWsuElement extends AbstractElement { - /** @var string */ - public const NS = C::NS_SEC_UTIL; + public const string NS = C::NS_SEC_UTIL; - /** @var string */ - public const NS_PREFIX = 'wsu'; + public const string NS_PREFIX = 'wsu'; - /** @var string */ - public const SCHEMA = 'resources/schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd'; + public const string SCHEMA = 'resources/schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd'; }