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
20 changes: 10 additions & 10 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, 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
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, 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
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, 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
Expand Down Expand Up @@ -215,8 +215,8 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the lowest supported version
php-version: '8.2'
extensions: ctype, date, dom, filter, pcre, soap, spl, xml
php-version: '8.3'
extensions: ctype, date, dom, filter, intl, pcre, soap, sodium, 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 @@ -10,15 +10,15 @@
}
],
"require": {
"php": "^8.2",
"php": "^8.3",
"ext-dom": "*",
"ext-spl": "*",

"simplesamlphp/assert": "~1.9",
"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": {
Expand Down
2 changes: 0 additions & 2 deletions src/Assert/DateTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
trait DateTimeTrait
{
/**
* @param string $value
* @param string $message
*/
protected static function validDateTime(string $value, string $message = ''): void
{
Expand Down
10 changes: 6 additions & 4 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
7 changes: 2 additions & 5 deletions src/Type/DateTimeValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
9 changes: 3 additions & 6 deletions src/XML/wsse/AbstractAttributedString.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -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
Expand All @@ -94,7 +92,6 @@ public static function fromXML(DOMElement $xml): static

/**
* @param \DOMElement|null $parent
* @return \DOMElement
*/
public function toXML(?DOMElement $parent = null): DOMElement
{
Expand Down
2 changes: 0 additions & 2 deletions src/XML/wsse/AbstractBinarySecurityTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down
8 changes: 2 additions & 6 deletions src/XML/wsse/AbstractEmbeddedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -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
{
Expand Down
2 changes: 0 additions & 2 deletions src/XML/wsse/AbstractEncodedString.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -78,7 +77,6 @@ public static function fromXML(DOMElement $xml): static

/**
* @param \DOMElement|null $parent
* @return \DOMElement
*/
public function toXML(?DOMElement $parent = null): DOMElement
{
Expand Down
2 changes: 0 additions & 2 deletions src/XML/wsse/AbstractKeyIdentifierType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down
2 changes: 0 additions & 2 deletions src/XML/wsse/AbstractPasswordString.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -77,7 +76,6 @@ public static function fromXML(DOMElement $xml): static

/**
* @param \DOMElement|null $parent
* @return \DOMElement
*/
public function toXML(?DOMElement $parent = null): DOMElement
{
Expand Down
4 changes: 1 addition & 3 deletions src/XML/wsse/AbstractReferenceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -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
Expand All @@ -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
{
Expand Down
8 changes: 2 additions & 6 deletions src/XML/wsse/AbstractSecurityHeaderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand All @@ -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
{
Expand All @@ -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
Expand All @@ -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
{
Expand Down
11 changes: 3 additions & 8 deletions src/XML/wsse/AbstractSecurityTokenReferenceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -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
{
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
{
Expand Down
Loading