From 257df0e40698a5c169717f0a4be115572dc5e108 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 13 Dec 2023 23:07:27 +0100 Subject: [PATCH] Start using PHP 8.1 features --- phpunit.xml | 10 ++++++---- src/Constants.php | 15 --------------- src/SOAP11/XML/env/Body.php | 5 +++-- src/SOAP11/XML/env/Detail.php | 6 +++--- src/SOAP11/XML/env/Envelope.php | 5 +++-- src/SOAP11/XML/env/Header.php | 6 +++--- src/SOAP12/Fault.php | 19 +++++++++++++++++++ src/SOAP12/XML/env/Body.php | 5 +++-- src/SOAP12/XML/env/Code.php | 5 +++-- src/SOAP12/XML/env/Detail.php | 6 +++--- src/SOAP12/XML/env/Envelope.php | 4 ++-- src/SOAP12/XML/env/Header.php | 6 +++--- src/SOAP12/XML/env/Text.php | 1 - 13 files changed, 51 insertions(+), 42 deletions(-) create mode 100644 src/SOAP12/Fault.php diff --git a/phpunit.xml b/phpunit.xml index a216031..c24bbe8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,9 +1,6 @@ - + - - ./src - @@ -14,4 +11,9 @@ + + + ./src + + diff --git a/src/Constants.php b/src/Constants.php index aa96cd2..26d4268 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -28,21 +28,6 @@ class Constants extends \SimpleSAML\XML\Constants public const NS_SOAP_ENC = 'http://www.w3.org/2003/05/soap-encoding'; /** - * The fault codes defined by the specification */ - public const FAULT_VERSION_MISMATCH = 'VersionMismatch'; - public const FAULT_MUST_UNDERSTAND = 'MustUnderstand'; - public const FAULT_SENDER = 'Sender'; - public const FAULT_RESPONDER = 'Responder'; - public const FAULT_DATA_ENCODING_UNKNOWN = 'DataEncodingUnknown'; - - public const FAULT_CODES = [ - self::FAULT_VERSION_MISMATCH, - self::FAULT_MUST_UNDERSTAND, - self::FAULT_SENDER, - self::FAULT_RESPONDER, - self::FAULT_DATA_ENCODING_UNKNOWN, - ]; - public const SOAP_ACTOR_NEXT = 'http://schemas.xmlsoap.org/soap/actor/next'; } diff --git a/src/SOAP11/XML/env/Body.php b/src/SOAP11/XML/env/Body.php index 66970d2..899effb 100644 --- a/src/SOAP11/XML/env/Body.php +++ b/src/SOAP11/XML/env/Body.php @@ -12,6 +12,7 @@ use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\XsNamespace as NS; use function array_diff; use function array_filter; @@ -29,10 +30,10 @@ final class Body extends AbstractSoapElement use ExtendableElementTrait; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = C::XS_ANY_NS_ANY; + public const XS_ANY_ELT_NAMESPACE = NS::ANY; /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = C::XS_ANY_NS_ANY; + public const XS_ANY_ATTR_NAMESPACE = NS::ANY; /** * @var \SimpleSAML\SOAP11\XML\env\Fault|null diff --git a/src/SOAP11/XML/env/Detail.php b/src/SOAP11/XML/env/Detail.php index df6523f..f991e7b 100644 --- a/src/SOAP11/XML/env/Detail.php +++ b/src/SOAP11/XML/env/Detail.php @@ -8,10 +8,10 @@ use SimpleSAML\Assert\Assert; use SimpleSAML\XML\AbstractElement; use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\Constants as C; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\XsNamespace as NS; /** * Class representing a env:Detail element. @@ -33,10 +33,10 @@ final class Detail extends AbstractElement public const NS_PREFIX = null; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = C::XS_ANY_NS_ANY; + public const XS_ANY_ELT_NAMESPACE = NS::ANY; /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = C::XS_ANY_NS_ANY; + public const XS_ANY_ATTR_NAMESPACE = NS::ANY; /** diff --git a/src/SOAP11/XML/env/Envelope.php b/src/SOAP11/XML/env/Envelope.php index 7c7589e..e97c9a7 100644 --- a/src/SOAP11/XML/env/Envelope.php +++ b/src/SOAP11/XML/env/Envelope.php @@ -13,6 +13,7 @@ use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XML\ExtendableAttributesTrait; +use SimpleSAML\XML\XsNamespace as NS; /** * Class representing a env:Envelope element. @@ -25,10 +26,10 @@ final class Envelope extends AbstractSoapElement use ExtendableAttributesTrait; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = C::XS_ANY_NS_OTHER; + public const XS_ANY_ELT_NAMESPACE = NS::OTHER; /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = C::XS_ANY_NS_OTHER; + public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** diff --git a/src/SOAP11/XML/env/Header.php b/src/SOAP11/XML/env/Header.php index 0e80599..0811b1c 100644 --- a/src/SOAP11/XML/env/Header.php +++ b/src/SOAP11/XML/env/Header.php @@ -7,10 +7,10 @@ use DOMElement; use SimpleSAML\Assert\Assert; use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\Constants as C; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; +use SimpleSAML\XML\XsNamespace as NS; /** * Class representing a env:Header element. @@ -23,10 +23,10 @@ final class Header extends AbstractSoapElement use ExtendableElementTrait; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = C::XS_ANY_NS_OTHER; + public const XS_ANY_ELT_NAMESPACE = NS::OTHER; /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = C::XS_ANY_NS_OTHER; + public const XS_ANY_ATTR_NAMESPACE = NS::OTHER; /** diff --git a/src/SOAP12/Fault.php b/src/SOAP12/Fault.php new file mode 100644 index 0000000..b9b2ead --- /dev/null +++ b/src/SOAP12/Fault.php @@ -0,0 +1,19 @@ +