From e85faf4b86c58319bb79979bc908b2c029172d7c Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 16 Dec 2025 23:16:20 +0100 Subject: [PATCH 1/2] Add ext-intl + ext-sodium for composer-require-checker --- .github/workflows/php.yml | 18 +++++++++--------- composer.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 6a3fddf5..6bd6e1e1 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: Print OpenSSL version @@ -56,7 +56,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml + extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, sodium, spl, xml tools: composer ini-values: error_reporting=E_ALL coverage: pcov @@ -110,7 +110,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: Print OpenSSL version @@ -121,7 +121,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml + extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, sodium, spl, xml tools: composer ini-values: error_reporting=E_ALL coverage: none @@ -169,7 +169,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, hash, mbstring, openssl, pcre, spl, xml + extensions: ctype, date, dom, filter, hash, intl, mbstring, openssl, pcre, sodium, spl, xml coverage: none - name: Setup problem matchers for PHP @@ -221,7 +221,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, hash, mbstring, openssl, pcre, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index e72868e9..61b657d4 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ } }, "require": { - "php": "^8.2", + "php": "^8.3", "ext-dom": "*", "ext-hash": "*", "ext-mbstring": "*", @@ -47,7 +47,7 @@ "simplesamlphp/xml-common": "~2.4" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "~1.10" + "simplesamlphp/simplesamlphp-test-framework": "~1.11" }, "config": { "allow-plugins": { From e5217303ae48796eda1f0f5ad0df345047783b16 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 16 Dec 2025 23:59:50 +0100 Subject: [PATCH 2/2] Typed constants --- src/Alg/Encryption/AbstractEncryptor.php | 4 +- .../Encryption/EncryptionAlgorithmFactory.php | 6 +- .../KeyTransport/AbstractKeyTransporter.php | 4 +- .../KeyTransportAlgorithmFactory.php | 6 +- src/Alg/Signature/AbstractSigner.php | 5 +- src/Alg/Signature/HMAC.php | 3 +- .../Signature/SignatureAlgorithmFactory.php | 6 +- src/Assert/HMACOutputLengthTrait.php | 2 - src/Assert/KeySizeTrait.php | 2 - src/Backend/HMAC.php | 1 - src/Backend/OpenSSL.php | 9 +- src/Constants.php | 116 +++++++++--------- src/CryptoEncoding/PEM.php | 41 ++----- src/CryptoEncoding/PEMBundle.php | 13 -- src/Exception/OpenSSLException.php | 1 - src/Exception/ProtocolViolationException.php | 1 - .../ReferenceValidationFailedException.php | 1 - .../SignatureVerificationFailedException.php | 1 - .../UnsupportedAlgorithmException.php | 1 - src/Key/PublicKey.php | 18 +-- src/TestUtils/PEMCertificatesMock.php | 44 +++---- src/TestUtils/SignedElementTestTrait.php | 3 +- src/Type/CryptoBinaryValue.php | 2 - src/Type/DigestValue.php | 2 - src/Type/ECPointValue.php | 2 - src/Type/HMACOutputLengthValue.php | 2 - src/Type/KeySizeValue.php | 2 - src/Utils/Certificate.php | 18 +-- src/XML/CanonicalizableElementInterface.php | 1 - src/XML/CanonicalizableElementTrait.php | 3 - src/XML/EncryptableElementTrait.php | 7 +- src/XML/EncryptedElementInterface.php | 2 - src/XML/EncryptedElementTrait.php | 4 +- src/XML/SignableElementTrait.php | 1 - src/XML/SignedElementInterface.php | 7 +- src/XML/SignedElementTrait.php | 8 +- src/XML/ds/AbstractDSAKeyValueType.php | 1 - src/XML/ds/AbstractDsElement.php | 9 +- src/XML/ds/AbstractKeyInfoType.php | 4 +- src/XML/ds/AbstractPGPDataType.php | 4 +- src/XML/ds/AbstractSPKIDataType.php | 1 - src/XML/ds/CanonicalizationMethod.php | 1 - src/XML/ds/DigestMethod.php | 3 +- src/XML/ds/DigestValue.php | 3 +- src/XML/ds/DsObject.php | 10 +- src/XML/ds/Exponent.php | 3 +- src/XML/ds/G.php | 3 +- src/XML/ds/HMACOutputLength.php | 3 +- src/XML/ds/J.php | 3 +- src/XML/ds/KeyInfo.php | 1 - src/XML/ds/KeyName.php | 3 +- src/XML/ds/KeyValue.php | 4 +- src/XML/ds/Manifest.php | 2 - src/XML/ds/MgmtData.php | 3 +- src/XML/ds/Modulus.php | 3 +- src/XML/ds/P.php | 3 +- src/XML/ds/PGPKeyID.php | 3 +- src/XML/ds/PGPKeyPacket.php | 3 +- src/XML/ds/PgenCounter.php | 3 +- src/XML/ds/Q.php | 3 +- src/XML/ds/RSAKeyValue.php | 2 - src/XML/ds/Reference.php | 4 - src/XML/ds/RetrievalMethod.php | 2 - src/XML/ds/SPKISexp.php | 3 +- src/XML/ds/Seed.php | 3 +- src/XML/ds/Signature.php | 2 - src/XML/ds/SignatureMethod.php | 4 +- src/XML/ds/SignatureProperties.php | 2 - src/XML/ds/SignatureProperty.php | 4 +- src/XML/ds/SignatureValue.php | 2 - src/XML/ds/SignedInfo.php | 5 - src/XML/ds/Transform.php | 2 - src/XML/ds/Transforms.php | 4 - src/XML/ds/X509CRL.php | 3 +- src/XML/ds/X509Certificate.php | 3 +- src/XML/ds/X509Data.php | 6 +- src/XML/ds/X509IssuerName.php | 3 +- src/XML/ds/X509IssuerSerial.php | 2 - src/XML/ds/X509SKI.php | 3 +- src/XML/ds/X509SerialNumber.php | 3 +- src/XML/ds/X509SubjectName.php | 3 +- src/XML/ds/XPath.php | 2 - src/XML/ds/Y.php | 3 +- src/XML/dsig11/A.php | 3 +- .../dsig11/AbstractCharTwoFieldParamsType.php | 1 - src/XML/dsig11/AbstractCurveType.php | 1 - src/XML/dsig11/AbstractDsig11Element.php | 9 +- src/XML/dsig11/AbstractECKeyValueType.php | 1 - src/XML/dsig11/AbstractECParametersType.php | 1 - .../dsig11/AbstractECValidationDataType.php | 1 - src/XML/dsig11/AbstractFieldIDType.php | 4 +- src/XML/dsig11/AbstractNamedCurveType.php | 1 - src/XML/dsig11/AbstractPnBFieldParamsType.php | 1 - .../dsig11/AbstractPrimeFieldParamsType.php | 1 - src/XML/dsig11/AbstractTnBFieldParamsType.php | 1 - src/XML/dsig11/B.php | 3 +- src/XML/dsig11/Base.php | 3 +- src/XML/dsig11/CoFactor.php | 3 +- src/XML/dsig11/Curve.php | 1 - src/XML/dsig11/DEREncodedKeyValue.php | 2 - src/XML/dsig11/ECKeyValue.php | 1 - src/XML/dsig11/ECParameters.php | 1 - src/XML/dsig11/FieldID.php | 1 - src/XML/dsig11/GnB.php | 1 - src/XML/dsig11/K.php | 3 +- src/XML/dsig11/K1.php | 3 +- src/XML/dsig11/K2.php | 3 +- src/XML/dsig11/K3.php | 3 +- src/XML/dsig11/KeyInfoReference.php | 2 - src/XML/dsig11/M.php | 3 +- src/XML/dsig11/NamedCurve.php | 1 - src/XML/dsig11/Order.php | 3 +- src/XML/dsig11/P.php | 3 +- src/XML/dsig11/PnB.php | 1 - src/XML/dsig11/Prime.php | 1 - src/XML/dsig11/PublicKey.php | 3 +- src/XML/dsig11/Seed.php | 6 +- src/XML/dsig11/TnB.php | 1 - src/XML/dsig11/ValidationData.php | 1 - src/XML/dsig11/X509Digest.php | 2 - src/XML/ec/AbstractEcElement.php | 9 +- src/XML/ec/InclusiveNamespaces.php | 2 - src/XML/xenc/AbstractAgreementMethodType.php | 4 +- src/XML/xenc/AbstractDHKeyValueType.php | 2 - src/XML/xenc/AbstractEncryptedType.php | 2 - src/XML/xenc/AbstractEncryptionMethod.php | 4 +- .../xenc/AbstractEncryptionPropertyType.php | 4 +- src/XML/xenc/AbstractReference.php | 2 +- src/XML/xenc/AbstractXencElement.php | 9 +- src/XML/xenc/CarriedKeyName.php | 3 +- src/XML/xenc/CipherValue.php | 3 +- src/XML/xenc/Generator.php | 3 +- src/XML/xenc/KANonce.php | 6 +- src/XML/xenc/KeySize.php | 3 +- src/XML/xenc/OAEPparams.php | 3 +- src/XML/xenc/OriginatorKeyInfo.php | 7 +- src/XML/xenc/P.php | 3 +- src/XML/xenc/PgenCounter.php | 6 +- src/XML/xenc/Q.php | 3 +- src/XML/xenc/RecipientKeyInfo.php | 7 +- src/XML/xenc/Seed.php | 6 +- src/XML/xenc/Transforms.php | 4 - src/XML/xenc/XencPublic.php | 6 +- src/XML/xenc11/AbstractDerivedKeyType.php | 2 - .../AbstractKeyDerivationMethodType.php | 2 +- src/XML/xenc11/AbstractXenc11Element.php | 9 +- src/XML/xenc11/DerivedKeyName.php | 3 +- src/XML/xenc11/IterationCount.php | 2 - src/XML/xenc11/KeyLength.php | 2 - src/XML/xenc11/MasterKeyName.php | 3 +- src/XML/xenc11/PBKDF2params.php | 3 +- src/XML/xenc11/Parameters.php | 8 +- src/XML/xenc11/Specified.php | 3 +- .../Alg/KeyTransport/RSAKeyTransportTest.php | 3 +- tests/Alg/Signature/HMACSignatureTest.php | 6 +- tests/Alg/Signature/RSASignatureTest.php | 3 +- tests/Backend/HMACTest.php | 6 +- tests/Backend/OpenSSLTest.php | 3 +- tests/XML/CustomSignable.php | 7 +- tests/XML/EncryptedCustom.php | 6 +- tests/XML/EncryptedCustomTest.php | 1 - tests/XML/SignableElementTest.php | 2 - tests/XML/SignedElementTest.php | 3 - 163 files changed, 227 insertions(+), 529 deletions(-) diff --git a/src/Alg/Encryption/AbstractEncryptor.php b/src/Alg/Encryption/AbstractEncryptor.php index 3b22d4e5..17069adb 100644 --- a/src/Alg/Encryption/AbstractEncryptor.php +++ b/src/Alg/Encryption/AbstractEncryptor.php @@ -17,8 +17,7 @@ */ abstract class AbstractEncryptor implements EncryptionAlgorithmInterface { - /** @var string */ - protected const DEFAULT_BACKEND = Backend\OpenSSL::class; + protected const string DEFAULT_BACKEND = Backend\OpenSSL::class; /** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend */ @@ -54,7 +53,6 @@ public function __construct( /** - * @return string */ public function getAlgorithmId(): string { diff --git a/src/Alg/Encryption/EncryptionAlgorithmFactory.php b/src/Alg/Encryption/EncryptionAlgorithmFactory.php index 6a19a83f..8febdb96 100644 --- a/src/Alg/Encryption/EncryptionAlgorithmFactory.php +++ b/src/Alg/Encryption/EncryptionAlgorithmFactory.php @@ -27,7 +27,7 @@ final class EncryptionAlgorithmFactory * * @var string[] */ - public const DEFAULT_BLACKLIST = [ + public const array DEFAULT_BLACKLIST = [ C::BLOCK_ENC_3DES, ]; @@ -36,7 +36,7 @@ final class EncryptionAlgorithmFactory * * @var class-string[] */ - private const SUPPORTED_DEFAULTS = [ + private const array SUPPORTED_DEFAULTS = [ TripleDES::class, AES::class, ]; @@ -51,8 +51,6 @@ final class EncryptionAlgorithmFactory /** * Whether the factory has been initialized or not. - * - * @var bool */ protected static bool $initialized = false; diff --git a/src/Alg/KeyTransport/AbstractKeyTransporter.php b/src/Alg/KeyTransport/AbstractKeyTransporter.php index 131c93c0..d9312f74 100644 --- a/src/Alg/KeyTransport/AbstractKeyTransporter.php +++ b/src/Alg/KeyTransport/AbstractKeyTransporter.php @@ -17,8 +17,7 @@ */ abstract class AbstractKeyTransporter implements KeyTransportAlgorithmInterface { - /** @var string */ - protected const DEFAULT_BACKEND = Backend\OpenSSL::class; + protected const string DEFAULT_BACKEND = Backend\OpenSSL::class; /** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend */ @@ -54,7 +53,6 @@ public function __construct( /** - * @return string */ public function getAlgorithmId(): string { diff --git a/src/Alg/KeyTransport/KeyTransportAlgorithmFactory.php b/src/Alg/KeyTransport/KeyTransportAlgorithmFactory.php index 87f47bf7..c0b6b154 100644 --- a/src/Alg/KeyTransport/KeyTransportAlgorithmFactory.php +++ b/src/Alg/KeyTransport/KeyTransportAlgorithmFactory.php @@ -25,7 +25,7 @@ class KeyTransportAlgorithmFactory * * @var string[] */ - public const DEFAULT_BLACKLIST = [ + public const array DEFAULT_BLACKLIST = [ C::KEY_TRANSPORT_RSA_1_5, ]; @@ -34,7 +34,7 @@ class KeyTransportAlgorithmFactory * * @var class-string[] */ - private const SUPPORTED_DEFAULTS = [ + private const array SUPPORTED_DEFAULTS = [ RSA::class, ]; @@ -48,8 +48,6 @@ class KeyTransportAlgorithmFactory /** * Whether the factory has been initialized or not. - * - * @var bool */ protected static bool $initialized = false; diff --git a/src/Alg/Signature/AbstractSigner.php b/src/Alg/Signature/AbstractSigner.php index 2bef2897..45edb19a 100644 --- a/src/Alg/Signature/AbstractSigner.php +++ b/src/Alg/Signature/AbstractSigner.php @@ -17,8 +17,7 @@ */ abstract class AbstractSigner implements SignatureAlgorithmInterface { - /** @var string */ - protected const DEFAULT_BACKEND = Backend\OpenSSL::class; + protected const string DEFAULT_BACKEND = Backend\OpenSSL::class; /** @var \SimpleSAML\XMLSecurity\Backend\SignatureBackend */ @@ -57,7 +56,6 @@ public function __construct( /** - * @return string */ public function getAlgorithmId(): string { @@ -66,7 +64,6 @@ public function getAlgorithmId(): string /** - * @return string */ public function getDigest(): string { diff --git a/src/Alg/Signature/HMAC.php b/src/Alg/Signature/HMAC.php index 071f35b2..e00a13cd 100644 --- a/src/Alg/Signature/HMAC.php +++ b/src/Alg/Signature/HMAC.php @@ -15,8 +15,7 @@ */ final class HMAC extends AbstractSigner implements SignatureAlgorithmInterface { - /** @var string */ - protected const DEFAULT_BACKEND = Backend\HMAC::class; + protected const string DEFAULT_BACKEND = Backend\HMAC::class; /** diff --git a/src/Alg/Signature/SignatureAlgorithmFactory.php b/src/Alg/Signature/SignatureAlgorithmFactory.php index 057051ec..913ed736 100644 --- a/src/Alg/Signature/SignatureAlgorithmFactory.php +++ b/src/Alg/Signature/SignatureAlgorithmFactory.php @@ -27,7 +27,7 @@ final class SignatureAlgorithmFactory * * @var string[] */ - public const DEFAULT_BLACKLIST = [ + public const array DEFAULT_BLACKLIST = [ C::SIG_RSA_SHA1, C::SIG_HMAC_SHA1, ]; @@ -37,7 +37,7 @@ final class SignatureAlgorithmFactory * * @var class-string[] */ - private const SUPPORTED_DEFAULTS = [ + private const array SUPPORTED_DEFAULTS = [ RSA::class, HMAC::class, ]; @@ -52,8 +52,6 @@ final class SignatureAlgorithmFactory /** * Whether the factory has been initialized or not. - * - * @var bool */ protected static bool $initialized = false; diff --git a/src/Assert/HMACOutputLengthTrait.php b/src/Assert/HMACOutputLengthTrait.php index f9fcb3d1..09d84895 100644 --- a/src/Assert/HMACOutputLengthTrait.php +++ b/src/Assert/HMACOutputLengthTrait.php @@ -19,8 +19,6 @@ trait HMACOutputLengthTrait * The HMAC algorithm (RFC2104 [HMAC]) takes the output (truncation) length in bits as a parameter; * this specification REQUIRES that the truncation length be a multiple of 8 (i.e. fall on a byte boundary) * because Base64 encoding operates on full bytes - * - * @var string */ private static string $HMACOutputLength_regex = '/^([1-9]\d*)$/D'; diff --git a/src/Assert/KeySizeTrait.php b/src/Assert/KeySizeTrait.php index 32640e9b..0d5359cb 100644 --- a/src/Assert/KeySizeTrait.php +++ b/src/Assert/KeySizeTrait.php @@ -14,8 +14,6 @@ trait KeySizeTrait /** * The size in bits of the key to be derived from the shared secret as the UTF-8 string for the corresponding * decimal integer with only digits in the string and no leading zeros. - * - * @var string */ private static string $keySize_regex = '/^([1-9]\d*)$/D'; diff --git a/src/Backend/HMAC.php b/src/Backend/HMAC.php index 12bc958e..8f18b5f6 100644 --- a/src/Backend/HMAC.php +++ b/src/Backend/HMAC.php @@ -19,7 +19,6 @@ */ final class HMAC implements SignatureBackend { - /** @var string */ protected string $digest; diff --git a/src/Backend/OpenSSL.php b/src/Backend/OpenSSL.php index 35092cec..d2bdf68d 100644 --- a/src/Backend/OpenSSL.php +++ b/src/Backend/OpenSSL.php @@ -31,29 +31,22 @@ */ final class OpenSSL implements EncryptionBackend, SignatureBackend { - /** @var int */ - public const AUTH_TAG_LEN = 16; + public const int AUTH_TAG_LEN = 16; // digital signature options - /** @var string */ protected string $digest; // asymmetric encryption options - /** @var int */ protected int $padding = OPENSSL_PKCS1_OAEP_PADDING; // symmetric encryption options - /** @var string */ protected string $cipher; - /** @var int */ protected int $blocksize; - /** @var int */ protected int $keysize; - /** @var bool */ protected bool $useAuthTag = false; diff --git a/src/Constants.php b/src/Constants.php index 4fc21b12..9caf795d 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -14,154 +14,154 @@ class Constants extends \SimpleSAML\XML\Constants /** * Symmetric key wrap algorithms */ - public const KEY_WRAP_3DES = 'http://www.w3.org/2001/04/xmlenc#kw-tripledes'; + public const string KEY_WRAP_3DES = 'http://www.w3.org/2001/04/xmlenc#kw-tripledes'; - public const KEY_WRAP_AES128 = 'http://www.w3.org/2001/04/xmlenc#kw-aes128'; + public const string KEY_WRAP_AES128 = 'http://www.w3.org/2001/04/xmlenc#kw-aes128'; - public const KEY_WRAP_AES192 = 'http://www.w3.org/2001/04/xmlenc#kw-aes192'; + public const string KEY_WRAP_AES192 = 'http://www.w3.org/2001/04/xmlenc#kw-aes192'; - public const KEY_WRAP_AES256 = 'http://www.w3.org/2001/04/xmlenc#kw-aes256'; + public const string KEY_WRAP_AES256 = 'http://www.w3.org/2001/04/xmlenc#kw-aes256'; /** * Key derivation algorithms */ - public const KEY_DERIVATION_CONCATKDF = 'http://www.w3.org/2009/xmlenc11#ConcatKDF'; + public const string KEY_DERIVATION_CONCATKDF = 'http://www.w3.org/2009/xmlenc11#ConcatKDF'; - public const KEY_DERIVATION_PBKDF2 = 'http://www.w3.org/2009/xmlenc11#pbkdf2'; + public const string KEY_DERIVATION_PBKDF2 = 'http://www.w3.org/2009/xmlenc11#pbkdf2'; /** * Key agreement algorithms */ - public const KEY_AGREEMENT_ECDH_ES = 'http://www.w3.org/2009/xmlenc11#ECDH-ES'; + public const string KEY_AGREEMENT_ECDH_ES = 'http://www.w3.org/2009/xmlenc11#ECDH-ES'; - public const KEY_AGREEMENT_DH = 'http://www.w3.org/2001/04/xmlenc#dh'; + public const string KEY_AGREEMENT_DH = 'http://www.w3.org/2001/04/xmlenc#dh'; - public const KEY_AGREEMENT_DH_ES = 'http://www.w3.org/2009/xmlenc11#dh-es'; + public const string KEY_AGREEMENT_DH_ES = 'http://www.w3.org/2009/xmlenc11#dh-es'; /** * Message digest algorithms */ - public const DIGEST_SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1'; + public const string DIGEST_SHA1 = 'http://www.w3.org/2000/09/xmldsig#sha1'; - public const DIGEST_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#sha224'; + public const string DIGEST_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#sha224'; - public const DIGEST_SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256'; + public const string DIGEST_SHA256 = 'http://www.w3.org/2001/04/xmlenc#sha256'; - public const DIGEST_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384'; + public const string DIGEST_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#sha384'; - public const DIGEST_SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512'; + public const string DIGEST_SHA512 = 'http://www.w3.org/2001/04/xmlenc#sha512'; - public const DIGEST_RIPEMD160 = 'http://www.w3.org/2001/04/xmlenc#ripemd160'; + public const string DIGEST_RIPEMD160 = 'http://www.w3.org/2001/04/xmlenc#ripemd160'; /** * Padding schemas */ - public const PADDING_PKCS1 = "PKCS1"; + public const string PADDING_PKCS1 = "PKCS1"; - public const PADDING_PKCS1_OAEP = "OAEP"; + public const string PADDING_PKCS1_OAEP = "OAEP"; /** * Block encryption algorithms */ - public const BLOCK_ENC_3DES = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc'; + public const string BLOCK_ENC_3DES = 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc'; - public const BLOCK_ENC_AES128 = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc'; + public const string BLOCK_ENC_AES128 = 'http://www.w3.org/2001/04/xmlenc#aes128-cbc'; - public const BLOCK_ENC_AES192 = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc'; + public const string BLOCK_ENC_AES192 = 'http://www.w3.org/2001/04/xmlenc#aes192-cbc'; - public const BLOCK_ENC_AES256 = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'; + public const string BLOCK_ENC_AES256 = 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'; - public const BLOCK_ENC_AES128_GCM = 'http://www.w3.org/2009/xmlenc11#aes128-gcm'; + public const string BLOCK_ENC_AES128_GCM = 'http://www.w3.org/2009/xmlenc11#aes128-gcm'; - public const BLOCK_ENC_AES192_GCM = 'http://www.w3.org/2009/xmlenc11#aes192-gcm'; + public const string BLOCK_ENC_AES192_GCM = 'http://www.w3.org/2009/xmlenc11#aes192-gcm'; - public const BLOCK_ENC_AES256_GCM = 'http://www.w3.org/2009xmlenc11#aes256-gcm'; + public const string BLOCK_ENC_AES256_GCM = 'http://www.w3.org/2009xmlenc11#aes256-gcm'; /** * Key transport algorithms */ - public const KEY_TRANSPORT_RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5'; + public const string KEY_TRANSPORT_RSA_1_5 = 'http://www.w3.org/2001/04/xmlenc#rsa-1_5'; - public const KEY_TRANSPORT_OAEP = 'http://www.w3.org/2009/xmlenc11#rsa-oaep'; + public const string KEY_TRANSPORT_OAEP = 'http://www.w3.org/2009/xmlenc11#rsa-oaep'; - public const KEY_TRANSPORT_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p'; + public const string KEY_TRANSPORT_OAEP_MGF1P = 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p'; /** * Canonicalization algorithms */ - public const C14N_INCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments'; + public const string C14N_INCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments'; - public const C14N_INCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; + public const string C14N_INCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'; - public const C14N_EXCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#WithComments'; + public const string C14N_EXCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#WithComments'; - public const C14N_EXCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#'; + public const string C14N_EXCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/2001/10/xml-exc-c14n#'; - public const C14N11_INCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/2006/12/xml-c14n11'; + public const string C14N11_INCLUSIVE_WITH_COMMENTS = 'http://www.w3.org/2006/12/xml-c14n11'; - public const C14N11_INCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/2006/12/xml-c14n11#WithComments'; + public const string C14N11_INCLUSIVE_WITHOUT_COMMENTS = 'http://www.w3.org/2006/12/xml-c14n11#WithComments'; /** * Signature algorithms */ - public const SIG_RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'; + public const string SIG_RSA_SHA1 = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'; - public const SIG_RSA_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224'; + public const string SIG_RSA_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha224'; - public const SIG_RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'; + public const string SIG_RSA_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'; - public const SIG_RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'; + public const string SIG_RSA_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'; - public const SIG_RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'; + public const string SIG_RSA_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'; - public const SIG_RSA_RIPEMD160 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160'; + public const string SIG_RSA_RIPEMD160 = 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160'; - public const SIG_HMAC_SHA1 = 'http://www.w3.org/2000/09/xmldsig#hmac-sha1'; + public const string SIG_HMAC_SHA1 = 'http://www.w3.org/2000/09/xmldsig#hmac-sha1'; - public const SIG_HMAC_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha224'; + public const string SIG_HMAC_SHA224 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha224'; - public const SIG_HMAC_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha256'; + public const string SIG_HMAC_SHA256 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha256'; - public const SIG_HMAC_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha384'; + public const string SIG_HMAC_SHA384 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha384'; - public const SIG_HMAC_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha512'; + public const string SIG_HMAC_SHA512 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha512'; - public const SIG_HMAC_RIPEMD160 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160'; + public const string SIG_HMAC_RIPEMD160 = 'http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160'; /** * Encoding algorithms */ - public const ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'; + public const string ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'; /** * Transforms algorithms */ - public const TRANSFORMS_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'; + public const string TRANSFORMS_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64'; /** * XML & XPath namespaces and identifiers */ - public const NS_XDSIG = 'http://www.w3.org/2000/09/xmldsig#'; + public const string NS_XDSIG = 'http://www.w3.org/2000/09/xmldsig#'; - public const NS_XDSIG11 = 'http://www.w3.org/2009/xmldsig11#'; + public const string NS_XDSIG11 = 'http://www.w3.org/2009/xmldsig11#'; - public const XMLDSIG_ENVELOPED = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'; + public const string XMLDSIG_ENVELOPED = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'; - public const XMLDSIG_MANIFEST = 'http://www.w3.org/2000/09/xmldsig#Manifest'; + public const string XMLDSIG_MANIFEST = 'http://www.w3.org/2000/09/xmldsig#Manifest'; - public const XMLDSIG11_DER_ENCODED_KEY_VALUE = 'https://www.w3.org/2009/xmldsig11#DEREncodedKeyValue'; + public const string XMLDSIG11_DER_ENCODED_KEY_VALUE = 'https://www.w3.org/2009/xmldsig11#DEREncodedKeyValue'; - public const NS_XENC = 'http://www.w3.org/2001/04/xmlenc#'; + public const string NS_XENC = 'http://www.w3.org/2001/04/xmlenc#'; - public const NS_XENC11 = 'http://www.w3.org/2009/xmlenc11#'; + public const string NS_XENC11 = 'http://www.w3.org/2009/xmlenc11#'; - public const XMLENC_CONTENT = 'http://www.w3.org/2001/04/xmlenc#Content'; + public const string XMLENC_CONTENT = 'http://www.w3.org/2001/04/xmlenc#Content'; - public const XMLENC_ELEMENT = 'http://www.w3.org/2001/04/xmlenc#Element'; + public const string XMLENC_ELEMENT = 'http://www.w3.org/2001/04/xmlenc#Element'; - public const XMLENC_ENCRYPTEDKEY = 'http://www.w3.org/2001/04/xmlenc#EncryptedKey'; + public const string XMLENC_ENCRYPTEDKEY = 'http://www.w3.org/2001/04/xmlenc#EncryptedKey'; - public const XMLENC_EXI = 'http://www.w3.org/2009/xmlenc11#EXI'; + public const string XMLENC_EXI = 'http://www.w3.org/2009/xmlenc11#EXI'; /** @var string[] */ diff --git a/src/CryptoEncoding/PEM.php b/src/CryptoEncoding/PEM.php index e10a8f82..58ace026 100644 --- a/src/CryptoEncoding/PEM.php +++ b/src/CryptoEncoding/PEM.php @@ -25,36 +25,34 @@ class PEM { // well-known PEM types - public const TYPE_CERTIFICATE = 'CERTIFICATE'; + public const string TYPE_CERTIFICATE = 'CERTIFICATE'; - public const TYPE_CRL = 'X509 CRL'; + public const string TYPE_CRL = 'X509 CRL'; - public const TYPE_CERTIFICATE_REQUEST = 'CERTIFICATE REQUEST'; + public const string TYPE_CERTIFICATE_REQUEST = 'CERTIFICATE REQUEST'; - public const TYPE_ATTRIBUTE_CERTIFICATE = 'ATTRIBUTE CERTIFICATE'; + public const string TYPE_ATTRIBUTE_CERTIFICATE = 'ATTRIBUTE CERTIFICATE'; - public const TYPE_PRIVATE_KEY = 'PRIVATE KEY'; + public const string TYPE_PRIVATE_KEY = 'PRIVATE KEY'; - public const TYPE_PUBLIC_KEY = 'PUBLIC KEY'; + public const string TYPE_PUBLIC_KEY = 'PUBLIC KEY'; - public const TYPE_ENCRYPTED_PRIVATE_KEY = 'ENCRYPTED PRIVATE KEY'; + public const string TYPE_ENCRYPTED_PRIVATE_KEY = 'ENCRYPTED PRIVATE KEY'; - public const TYPE_RSA_PRIVATE_KEY = 'RSA PRIVATE KEY'; + public const string TYPE_RSA_PRIVATE_KEY = 'RSA PRIVATE KEY'; - public const TYPE_RSA_PUBLIC_KEY = 'RSA PUBLIC KEY'; + public const string TYPE_RSA_PUBLIC_KEY = 'RSA PUBLIC KEY'; - public const TYPE_EC_PRIVATE_KEY = 'EC PRIVATE KEY'; + public const string TYPE_EC_PRIVATE_KEY = 'EC PRIVATE KEY'; - public const TYPE_PKCS7 = 'PKCS7'; + public const string TYPE_PKCS7 = 'PKCS7'; - public const TYPE_CMS = 'CMS'; + public const string TYPE_CMS = 'CMS'; /** * Regular expression to match PEM block. - * - * @var string */ - public const PEM_REGEX = + public const string PEM_REGEX = '/' . '(?:^|[\r\n])' . // line start '-----BEGIN (.+?)-----[\r\n]+' . // header @@ -77,7 +75,6 @@ public function __construct( /** - * @return string */ public function __toString(): string { @@ -88,11 +85,7 @@ public function __toString(): string /** * Initialize from a PEM-formatted string. * - * @param string $str - * * @throws \UnexpectedValueException If string is not valid PEM - * - * @return self */ public static function fromString(string $str): self { @@ -116,8 +109,6 @@ public static function fromString(string $str): self * @param string $filename Path to file * * @throws \RuntimeException If file reading fails - * - * @return self */ public static function fromFile(string $filename): self { @@ -136,8 +127,6 @@ public static function fromFile(string $filename): self /** * Get content type. - * - * @return string */ public function type(): string { @@ -147,8 +136,6 @@ public function type(): string /** * Get payload. - * - * @return string */ public function data(): string { @@ -158,8 +145,6 @@ public function data(): string /** * Encode to PEM string. - * - * @return string */ public function string(): string { diff --git a/src/CryptoEncoding/PEMBundle.php b/src/CryptoEncoding/PEMBundle.php index a7364077..8239fee7 100644 --- a/src/CryptoEncoding/PEMBundle.php +++ b/src/CryptoEncoding/PEMBundle.php @@ -51,7 +51,6 @@ public function __construct(PEM ...$pems) /** - * @return string */ public function __toString(): string { @@ -62,11 +61,7 @@ public function __toString(): string /** * Initialize from a string. * - * @param string $str - * * @throws \UnexpectedValueException - * - * @return self */ public static function fromString(string $str): self { @@ -97,11 +92,7 @@ function ($match) { /** * Initialize from a file. * - * @param string $filename - * * @throws \RuntimeException If file reading fails - * - * @return self */ public static function fromFile(string $filename): self { @@ -181,8 +172,6 @@ public function last(): PEM /** * @see \Countable::count() - * - * @return int */ public function count(): int { @@ -205,8 +194,6 @@ public function getIterator(): ArrayIterator /** * Encode bundle to a string of contiguous PEM blocks. - * - * @return string */ public function string(): string { diff --git a/src/Exception/OpenSSLException.php b/src/Exception/OpenSSLException.php index fb2fdc1d..47b631fc 100644 --- a/src/Exception/OpenSSLException.php +++ b/src/Exception/OpenSSLException.php @@ -14,7 +14,6 @@ class OpenSSLException extends RuntimeException { /** - * @param string $message */ public function __construct(string $message = 'Generic OpenSSL exception') { diff --git a/src/Exception/ProtocolViolationException.php b/src/Exception/ProtocolViolationException.php index b1574626..3aa33356 100644 --- a/src/Exception/ProtocolViolationException.php +++ b/src/Exception/ProtocolViolationException.php @@ -12,7 +12,6 @@ class ProtocolViolationException extends RuntimeException { /** - * @param string|null $message */ public function __construct(?string $message = null) { diff --git a/src/Exception/ReferenceValidationFailedException.php b/src/Exception/ReferenceValidationFailedException.php index 668e6734..029e9627 100644 --- a/src/Exception/ReferenceValidationFailedException.php +++ b/src/Exception/ReferenceValidationFailedException.php @@ -14,7 +14,6 @@ class ReferenceValidationFailedException extends SignatureVerificationFailedException { /** - * @param string $message */ public function __construct(string $message = 'Reference validation failed.') { diff --git a/src/Exception/SignatureVerificationFailedException.php b/src/Exception/SignatureVerificationFailedException.php index 5d126edd..30111873 100644 --- a/src/Exception/SignatureVerificationFailedException.php +++ b/src/Exception/SignatureVerificationFailedException.php @@ -14,7 +14,6 @@ class SignatureVerificationFailedException extends RuntimeException { /** - * @param string $message */ public function __construct(string $message = 'Signature verification failed.') { diff --git a/src/Exception/UnsupportedAlgorithmException.php b/src/Exception/UnsupportedAlgorithmException.php index c42975ac..756e8be6 100644 --- a/src/Exception/UnsupportedAlgorithmException.php +++ b/src/Exception/UnsupportedAlgorithmException.php @@ -14,7 +14,6 @@ class UnsupportedAlgorithmException extends RuntimeException { /** - * @param string $message */ public function __construct(string $message = 'Unsupported algorithm.') { diff --git a/src/Key/PublicKey.php b/src/Key/PublicKey.php index 82c93dec..473d9d9b 100644 --- a/src/Key/PublicKey.php +++ b/src/Key/PublicKey.php @@ -21,23 +21,17 @@ */ class PublicKey extends AsymmetricKey { - /** @var int */ - public const ASN1_TYPE_INTEGER = 0x02; // 2 + public const int ASN1_TYPE_INTEGER = 0x02; // 2 - /** @var int */ - public const ASN1_TYPE_BIT_STRING = 0x03; // 3 + public const int ASN1_TYPE_BIT_STRING = 0x03; // 3 - /** @var int */ - public const ASN1_TYPE_SEQUENCE = 0x30; // 16 + public const int ASN1_TYPE_SEQUENCE = 0x30; // 16 - /** @var int */ - public const ASN1_SIZE_128 = 0x80; // 128 + public const int ASN1_SIZE_128 = 0x80; // 128 - /** @var int */ - public const ASN1_SIZE_256 = 0x0100; // 256 + public const int ASN1_SIZE_256 = 0x0100; // 256 - /** @var int */ - public const ASN1_SIZE_65535 = 0x010000; // 65535 + public const int ASN1_SIZE_65535 = 0x010000; // 65535 /** diff --git a/src/TestUtils/PEMCertificatesMock.php b/src/TestUtils/PEMCertificatesMock.php index 9d4cfcc4..7f602c04 100644 --- a/src/TestUtils/PEMCertificatesMock.php +++ b/src/TestUtils/PEMCertificatesMock.php @@ -18,46 +18,45 @@ */ class PEMCertificatesMock { - public const CERTS_DIR = 'resources/certificates'; + public const string CERTS_DIR = 'resources/certificates'; - public const KEYS_DIR = 'resources/keys'; + public const string KEYS_DIR = 'resources/keys'; - public const PASSPHRASE = '1234'; + public const string PASSPHRASE = '1234'; - public const CERTIFICATE = 'signed.simplesamlphp.org.crt'; + public const string CERTIFICATE = 'signed.simplesamlphp.org.crt'; - public const PUBLIC_KEY = 'signed.simplesamlphp.org.pub'; + public const string PUBLIC_KEY = 'signed.simplesamlphp.org.pub'; - public const PRIVATE_KEY = 'signed.simplesamlphp.org.key'; + public const string PRIVATE_KEY = 'signed.simplesamlphp.org.key'; - public const OTHER_CERTIFICATE = 'other.simplesamlphp.org.crt'; + public const string OTHER_CERTIFICATE = 'other.simplesamlphp.org.crt'; - public const OTHER_PUBLIC_KEY = 'other.simplesamlphp.org.pub'; + public const string OTHER_PUBLIC_KEY = 'other.simplesamlphp.org.pub'; - public const OTHER_PRIVATE_KEY = 'other.simplesamlphp.org.key'; + public const string OTHER_PRIVATE_KEY = 'other.simplesamlphp.org.key'; - public const SELFSIGNED_CERTIFICATE = 'selfsigned.simplesamlphp.org.crt'; + public const string SELFSIGNED_CERTIFICATE = 'selfsigned.simplesamlphp.org.crt'; - public const SELFSIGNED_PUBLIC_KEY = 'selfsigned.simplesamlphp.org.pub'; + public const string SELFSIGNED_PUBLIC_KEY = 'selfsigned.simplesamlphp.org.pub'; - public const SELFSIGNED_PRIVATE_KEY = 'selfsigned.simplesamlphp.org.key'; + public const string SELFSIGNED_PRIVATE_KEY = 'selfsigned.simplesamlphp.org.key'; - public const BROKEN_CERTIFICATE = 'broken.simplesamlphp.org.crt'; + public const string BROKEN_CERTIFICATE = 'broken.simplesamlphp.org.crt'; - public const BROKEN_PUBLIC_KEY = 'broken.simplesamlphp.org.pub'; + public const string BROKEN_PUBLIC_KEY = 'broken.simplesamlphp.org.pub'; - public const BROKEN_PRIVATE_KEY = 'broken.simplesamlphp.org.key'; + public const string BROKEN_PRIVATE_KEY = 'broken.simplesamlphp.org.key'; - public const CORRUPTED_CERTIFICATE = 'corrupted.simplesamlphp.org.crt'; + public const string CORRUPTED_CERTIFICATE = 'corrupted.simplesamlphp.org.crt'; - public const CORRUPTED_PUBLIC_KEY = 'corrupted.simplesamlphp.org.pub'; + public const string CORRUPTED_PUBLIC_KEY = 'corrupted.simplesamlphp.org.pub'; - public const CORRUPTED_PRIVATE_KEY = 'corrupted.simplesamlphp.org.key'; + public const string CORRUPTED_PRIVATE_KEY = 'corrupted.simplesamlphp.org.key'; /** * @param string $file The file to use - * @return string */ public static function buildKeysPath(string $file): string { @@ -68,7 +67,6 @@ public static function buildKeysPath(string $file): string /** * @param string $file The file to use - * @return string */ public static function buildCertsPath(string $file): string { @@ -133,7 +131,6 @@ public static function getPrivateKey(string $file, string $passphrase = self::PA /** * @param string $file The file to use - * @return string */ public static function getPlainCertificate( string $file = self::CERTIFICATE, @@ -144,7 +141,6 @@ public static function getPlainCertificate( /** * @param string $file The file to use - * @return string */ public static function getPlainPublicKey( string $file = self::PUBLIC_KEY, @@ -155,7 +151,6 @@ public static function getPlainPublicKey( /** * @param string $file The file to use - * @return string */ public static function getPlainPrivateKey( string $file = self::PRIVATE_KEY, @@ -166,7 +161,6 @@ public static function getPlainPrivateKey( /** * @param string $file The file to use - * @return string */ public static function getPlainCertificateContents( string $file = self::CERTIFICATE, @@ -180,7 +174,6 @@ public static function getPlainCertificateContents( /** * @param string $file The file to use - * @return string */ public static function getPlainPublicKeyContents( string $file = self::PUBLIC_KEY, @@ -194,7 +187,6 @@ public static function getPlainPublicKeyContents( /** * @param string $file The file to use - * @return string */ public static function getPlainPrivateKeyContents( string $file = self::PRIVATE_KEY, diff --git a/src/TestUtils/SignedElementTestTrait.php b/src/TestUtils/SignedElementTestTrait.php index 8162c310..059cbd91 100644 --- a/src/TestUtils/SignedElementTestTrait.php +++ b/src/TestUtils/SignedElementTestTrait.php @@ -29,14 +29,13 @@ * you are testing to the $testedClass property. * * @package simplesamlphp/xml-security + * * @phpstan-ignore trait.unused */ trait SignedElementTestTrait { /** * A base document that we can reuse in our tests. - * - * @var \DOMDocument */ protected static DOMDocument $xmlRepresentation; diff --git a/src/Type/CryptoBinaryValue.php b/src/Type/CryptoBinaryValue.php index 75470b9f..d725171b 100644 --- a/src/Type/CryptoBinaryValue.php +++ b/src/Type/CryptoBinaryValue.php @@ -16,9 +16,7 @@ class CryptoBinaryValue extends Base64BinaryValue /** * Validate the value. * - * @param string $value * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure - * @return void */ protected function validateValue(string $value): void { diff --git a/src/Type/DigestValue.php b/src/Type/DigestValue.php index cca7df13..ddb4aa30 100644 --- a/src/Type/DigestValue.php +++ b/src/Type/DigestValue.php @@ -16,9 +16,7 @@ class DigestValue extends Base64BinaryValue /** * Validate the value. * - * @param string $value * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure - * @return void */ protected function validateValue(string $value): void { diff --git a/src/Type/ECPointValue.php b/src/Type/ECPointValue.php index adaade15..f66714c4 100644 --- a/src/Type/ECPointValue.php +++ b/src/Type/ECPointValue.php @@ -16,9 +16,7 @@ class ECPointValue extends CryptoBinaryValue /** * Validate the value. * - * @param string $value * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure - * @return void */ protected function validateValue(string $value): void { diff --git a/src/Type/HMACOutputLengthValue.php b/src/Type/HMACOutputLengthValue.php index 51803408..7a5ccb64 100644 --- a/src/Type/HMACOutputLengthValue.php +++ b/src/Type/HMACOutputLengthValue.php @@ -16,10 +16,8 @@ class HMACOutputLengthValue extends IntegerValue /** * Validate the value. * - * @param string $value * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure * @throws \SimpleSAML\XMLSecurity\Exception\ProtocolViolationException when not devisible by 8 - * @return void */ protected function validateValue(string $value): void { diff --git a/src/Type/KeySizeValue.php b/src/Type/KeySizeValue.php index 7349d631..e5f50259 100644 --- a/src/Type/KeySizeValue.php +++ b/src/Type/KeySizeValue.php @@ -16,9 +16,7 @@ class KeySizeValue extends IntegerValue /** * Validate the value. * - * @param string $value * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure - * @return void */ protected function validateValue(string $value): void { diff --git a/src/Utils/Certificate.php b/src/Utils/Certificate.php index c8bbdaa5..c60669a8 100644 --- a/src/Utils/Certificate.php +++ b/src/Utils/Certificate.php @@ -20,18 +20,17 @@ class Certificate /** * The pattern that the contents of a certificate should adhere to */ - public const CERTIFICATE_PATTERN = '/^-----BEGIN CERTIFICATE-----([^-]*)^-----END CERTIFICATE-----/m'; + public const string CERTIFICATE_PATTERN = + '/^-----BEGIN CERTIFICATE-----([^-]*)^-----END CERTIFICATE-----/m'; - public const PUBLIC_KEY_PATTERN = '/^-----BEGIN PUBLIC KEY-----([^-]*)^-----END PUBLIC KEY-----/m'; + public const string PUBLIC_KEY_PATTERN = + '/^-----BEGIN PUBLIC KEY-----([^-]*)^-----END PUBLIC KEY-----/m'; - public const PRIVATE_KEY_PATTERN = '/^-----BEGIN RSA PRIVATE KEY-----([^-]*)^-----END RSA PRIVATE KEY-----/m'; + public const string PRIVATE_KEY_PATTERN = + '/^-----BEGIN RSA PRIVATE KEY-----([^-]*)^-----END RSA PRIVATE KEY-----/m'; /** - * @param string $certificate - * @param string $pattern - * - * @return bool */ public static function hasValidStructure(string $certificate, string $pattern = self::PUBLIC_KEY_PATTERN): bool { @@ -40,9 +39,6 @@ public static function hasValidStructure(string $certificate, string $pattern = /** - * @param string $X509CertificateContents - * - * @return string */ public static function convertToCertificate(string $X509CertificateContents): string { @@ -54,8 +50,6 @@ public static function convertToCertificate(string $X509CertificateContents): st /** * @param array|string $issuer - * - * @return string */ public static function parseIssuer(array|string $issuer): string { diff --git a/src/XML/CanonicalizableElementInterface.php b/src/XML/CanonicalizableElementInterface.php index d539cd2c..ff8fea18 100644 --- a/src/XML/CanonicalizableElementInterface.php +++ b/src/XML/CanonicalizableElementInterface.php @@ -30,7 +30,6 @@ interface CanonicalizableElementInterface extends ElementInterface * @param string[]|null $xpaths An array of XPaths to filter the nodes by. Defaults to null (no filters). * @param string[]|null $prefixes An array of namespace prefixes to filter the nodes by. Defaults to null (no * filters). - * @return string */ public function canonicalize(string $method, ?array $xpaths = null, ?array $prefixes = null): string; } diff --git a/src/XML/CanonicalizableElementTrait.php b/src/XML/CanonicalizableElementTrait.php index 5c4e8a5a..d9b1ebaa 100644 --- a/src/XML/CanonicalizableElementTrait.php +++ b/src/XML/CanonicalizableElementTrait.php @@ -21,8 +21,6 @@ trait CanonicalizableElementTrait * Implement this method to return the DOMElement with the proper representation of this object. Whatever is * returned here will be used both to perform canonicalisation and to serialize the object, so that it can be * recovered later in its exact original state. - * - * @return \DOMElement */ abstract protected function getOriginalXML(): DOMElement; @@ -37,7 +35,6 @@ abstract protected function getOriginalXML(): DOMElement; * @param string[]|null $xpaths An array of XPaths to filter the nodes by. Defaults to null (no filters). * @param string[]|null $prefixes An array of namespace prefixes to filter the nodes by. Defaults to null (no * filters). - * @return string */ #[\NoDiscard] public function canonicalize(string $method, ?array $xpaths = null, ?array $prefixes = null): string diff --git a/src/XML/EncryptableElementTrait.php b/src/XML/EncryptableElementTrait.php index dece6c9b..d245586a 100644 --- a/src/XML/EncryptableElementTrait.php +++ b/src/XML/EncryptableElementTrait.php @@ -22,6 +22,7 @@ * Trait aggregating functionality for elements that can be encrypted. * * @package simplesamlphp/xml-security + * * @phpstan-ignore trait.unused */ trait EncryptableElementTrait @@ -30,8 +31,6 @@ trait EncryptableElementTrait * The length of the session key to use when encrypting. * * Override to change it if desired. - * - * @var int */ protected int $sessionKeyLen = 16; @@ -39,8 +38,6 @@ trait EncryptableElementTrait * The identifier of the block cipher to use to encrypt this object. * * Override to change it if desired. - * - * @var string */ protected string $blockCipherAlgId = C::BLOCK_ENC_AES256_GCM; @@ -122,8 +119,6 @@ abstract public function getBlacklistedAlgorithms(): ?array; /** * Return a string representation of this object. - * - * @return string */ abstract public function __toString(): string; } diff --git a/src/XML/EncryptedElementInterface.php b/src/XML/EncryptedElementInterface.php index b1ca008e..ec862520 100644 --- a/src/XML/EncryptedElementInterface.php +++ b/src/XML/EncryptedElementInterface.php @@ -26,8 +26,6 @@ public function decrypt(EncryptionAlgorithmInterface $decryptor): ElementInterfa /** * Whether the encrypted object is accompanied by the decryption key or not. - * - * @return bool */ public function hasDecryptionKey(): bool; diff --git a/src/XML/EncryptedElementTrait.php b/src/XML/EncryptedElementTrait.php index 4310edb1..665ced69 100644 --- a/src/XML/EncryptedElementTrait.php +++ b/src/XML/EncryptedElementTrait.php @@ -27,6 +27,7 @@ * Trait aggregating functionality for encrypted elements. * * @package simplesamlphp/xml-security + * * @phpstan-ignore trait.unused */ trait EncryptedElementTrait @@ -59,8 +60,6 @@ final public function __construct( /** * Whether the encrypted object is accompanied by the decryption key or not. - * - * @return bool */ public function hasDecryptionKey(): bool { @@ -214,7 +213,6 @@ public function toXML(?DOMElement $parent = null): DOMElement * have this method out of the box. * * @param \DOMElement|null $parent The element we should append to. - * @return \DOMElement */ abstract public function instantiateParentElement(?DOMElement $parent = null): DOMElement; diff --git a/src/XML/SignableElementTrait.php b/src/XML/SignableElementTrait.php index 6ba6a568..2a0913a5 100644 --- a/src/XML/SignableElementTrait.php +++ b/src/XML/SignableElementTrait.php @@ -46,7 +46,6 @@ trait SignableElementTrait /** @var \SimpleSAML\XMLSecurity\XML\ds\Signature|null */ protected ?Signature $signature = null; - /** @var string */ private string $c14nAlg = C::C14N_EXCLUSIVE_WITHOUT_COMMENTS; /** @var \SimpleSAML\XMLSecurity\XML\ds\KeyInfo|null */ diff --git a/src/XML/SignedElementInterface.php b/src/XML/SignedElementInterface.php index c7180b85..971d1230 100644 --- a/src/XML/SignedElementInterface.php +++ b/src/XML/SignedElementInterface.php @@ -45,8 +45,6 @@ public function getVerifyingKey(): ?KeyInterface; /** * Whether this object is signed or not. - * - * @return bool */ public function isSigned(): bool; @@ -58,9 +56,10 @@ public function isSigned(): bool; * but cannot be verified, an exception will be thrown. * * @param \SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmInterface|null $verifier The verifier to use to - * verify the signature. If null, attempt to verify it with the KeyInfo information in the signature. + * verify the signature. If null, attempt to verify it with the KeyInfo information in the signature. * @return \SimpleSAML\XMLSecurity\XML\SignedElementInterface The object processed again from its canonicalised - * representation verified by the signature. + * representation verified by the signature. + * * @throws \SimpleSAML\XMLSecurity\Exception\NoSignatureFoundException if the object is not signed. * @throws \SimpleSAML\XMLSecurity\Exception\InvalidArgumentException if no key is passed and there is no KeyInfo * in the signature. diff --git a/src/XML/SignedElementTrait.php b/src/XML/SignedElementTrait.php index ea6cd8b7..63b3327f 100644 --- a/src/XML/SignedElementTrait.php +++ b/src/XML/SignedElementTrait.php @@ -38,6 +38,7 @@ * Helper trait for processing signed elements. * * @package simplesamlphp/xml-security + * * @phpstan-ignore trait.unused */ trait SignedElementTrait @@ -237,8 +238,6 @@ public function getVerifyingKey(): ?KeyInterface /** * Whether this object is signed or not. - * - * @return bool */ public function isSigned(): bool { @@ -253,9 +252,10 @@ public function isSigned(): bool * but cannot be verified, an exception will be thrown. * * @param \SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmInterface|null $verifier The verifier to use to - * verify the signature. If null, attempt to verify it with the KeyInfo information in the signature. + * verify the signature. If null, attempt to verify it with the KeyInfo information in the signature. * @return \SimpleSAML\XMLSecurity\XML\SignedElementInterface The object processed again from its canonicalised - * representation verified by the signature. + * representation verified by the signature. + * * @throws \SimpleSAML\XMLSecurity\Exception\NoSignatureFoundException if the object is not signed. * @throws \SimpleSAML\XMLSecurity\Exception\InvalidArgumentException if no key is passed and there is no KeyInfo * in the signature. diff --git a/src/XML/ds/AbstractDSAKeyValueType.php b/src/XML/ds/AbstractDSAKeyValueType.php index 0e515a8f..906195c3 100644 --- a/src/XML/ds/AbstractDSAKeyValueType.php +++ b/src/XML/ds/AbstractDSAKeyValueType.php @@ -192,7 +192,6 @@ public static function fromXML(DOMElement $xml): static * Convert this DSAKeyValue object to XML. * * @param \DOMElement|null $parent The element we should append this DSAKeyValue to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/AbstractDsElement.php b/src/XML/ds/AbstractDsElement.php index 587dc681..26c8d958 100644 --- a/src/XML/ds/AbstractDsElement.php +++ b/src/XML/ds/AbstractDsElement.php @@ -14,12 +14,9 @@ */ abstract class AbstractDsElement extends AbstractElement { - /** @var string */ - public const NS = C::NS_XDSIG; + public const string NS = C::NS_XDSIG; - /** @var string */ - public const NS_PREFIX = 'ds'; + public const string NS_PREFIX = 'ds'; - /** @var string */ - public const SCHEMA = 'resources/schemas/xmldsig-core-schema.xsd'; + public const string SCHEMA = 'resources/schemas/xmldsig-core-schema.xsd'; } diff --git a/src/XML/ds/AbstractKeyInfoType.php b/src/XML/ds/AbstractKeyInfoType.php index 84300a18..94e7fae4 100644 --- a/src/XML/ds/AbstractKeyInfoType.php +++ b/src/XML/ds/AbstractKeyInfoType.php @@ -28,8 +28,7 @@ abstract class AbstractKeyInfoType extends AbstractDsElement use ExtendableElementTrait; - /** @var string */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -122,7 +121,6 @@ public function getInfo(): array * Convert this KeyInfo to XML. * * @param \DOMElement|null $parent The element we should append this KeyInfo to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/AbstractPGPDataType.php b/src/XML/ds/AbstractPGPDataType.php index 522ab56c..a8ab76f0 100644 --- a/src/XML/ds/AbstractPGPDataType.php +++ b/src/XML/ds/AbstractPGPDataType.php @@ -28,8 +28,7 @@ abstract class AbstractPGPDataType extends AbstractDsElement implements SchemaVa use SchemaValidatableElementTrait; - /** @var string */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -107,7 +106,6 @@ public static function fromXML(DOMElement $xml): static * Convert this PGPData to XML. * * @param \DOMElement|null $parent The element we should append this PGPData to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/AbstractSPKIDataType.php b/src/XML/ds/AbstractSPKIDataType.php index ea76f5dd..e8f5ad04 100644 --- a/src/XML/ds/AbstractSPKIDataType.php +++ b/src/XML/ds/AbstractSPKIDataType.php @@ -101,7 +101,6 @@ public static function fromXML(DOMElement $xml): static * Convert this SPKIData to XML. * * @param \DOMElement|null $parent The element we should append this SPKIData to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/CanonicalizationMethod.php b/src/XML/ds/CanonicalizationMethod.php index a84aa35a..e7a0cdf1 100644 --- a/src/XML/ds/CanonicalizationMethod.php +++ b/src/XML/ds/CanonicalizationMethod.php @@ -82,7 +82,6 @@ public static function fromXML(DOMElement $xml): static * Convert this CanonicalizationMethod element to XML. * * @param \DOMElement|null $parent The element we should append this KeyName element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/DigestMethod.php b/src/XML/ds/DigestMethod.php index 3c053402..7d608b76 100644 --- a/src/XML/ds/DigestMethod.php +++ b/src/XML/ds/DigestMethod.php @@ -29,7 +29,7 @@ final class DigestMethod extends AbstractDsElement implements SchemaValidatableE /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -89,7 +89,6 @@ public static function fromXML(DOMElement $xml): static * Convert this DigestMethod element to XML. * * @param \DOMElement|null $parent The element we should append this DigestMethod element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/DigestValue.php b/src/XML/ds/DigestValue.php index 55bae528..4ff099bf 100644 --- a/src/XML/ds/DigestValue.php +++ b/src/XML/ds/DigestValue.php @@ -20,6 +20,5 @@ final class DigestValue extends AbstractDsElement implements SchemaValidatableEl use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = DigestValueType::class; + public const string TEXTCONTENT_TYPE = DigestValueType::class; } diff --git a/src/XML/ds/DsObject.php b/src/XML/ds/DsObject.php index c3bbbb1e..ebaec1de 100644 --- a/src/XML/ds/DsObject.php +++ b/src/XML/ds/DsObject.php @@ -28,11 +28,9 @@ final class DsObject extends AbstractDsElement implements SchemaValidatableEleme use SchemaValidatableElementTrait; - /** @var string */ - public const LOCALNAME = 'Object'; + public const string LOCALNAME = 'Object'; - /** @var string */ - public const XS_ANY_ELT_NAMESPACE = NS::ANY; + public const string XS_ANY_ELT_NAMESPACE = NS::ANY; /** @@ -88,8 +86,6 @@ public function getEncoding(): ?AnyURIValue /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -104,7 +100,6 @@ public function isEmptyElement(): bool * Convert XML into a ds:Object * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -127,7 +122,6 @@ public static function fromXML(DOMElement $xml): static * Convert this ds:Object element to XML. * * @param \DOMElement|null $parent The element we should append this ds:Object element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/Exponent.php b/src/XML/ds/Exponent.php index adb2b5e5..b966fa59 100644 --- a/src/XML/ds/Exponent.php +++ b/src/XML/ds/Exponent.php @@ -17,6 +17,5 @@ final class Exponent extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/G.php b/src/XML/ds/G.php index 27af77d0..8558a92d 100644 --- a/src/XML/ds/G.php +++ b/src/XML/ds/G.php @@ -17,6 +17,5 @@ final class G extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/HMACOutputLength.php b/src/XML/ds/HMACOutputLength.php index a86a6f28..7ed4e4a4 100644 --- a/src/XML/ds/HMACOutputLength.php +++ b/src/XML/ds/HMACOutputLength.php @@ -17,6 +17,5 @@ final class HMACOutputLength extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = HMACOutputLengthValue::class; + public const string TEXTCONTENT_TYPE = HMACOutputLengthValue::class; } diff --git a/src/XML/ds/J.php b/src/XML/ds/J.php index 9a427b7d..1cb4bcbd 100644 --- a/src/XML/ds/J.php +++ b/src/XML/ds/J.php @@ -17,6 +17,5 @@ final class J extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/KeyInfo.php b/src/XML/ds/KeyInfo.php index c63b3cb5..d66b607b 100644 --- a/src/XML/ds/KeyInfo.php +++ b/src/XML/ds/KeyInfo.php @@ -28,7 +28,6 @@ final class KeyInfo extends AbstractKeyInfoType implements SchemaValidatableElem * Convert XML into a KeyInfo * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/ds/KeyName.php b/src/XML/ds/KeyName.php index 63eda11b..61e27f30 100644 --- a/src/XML/ds/KeyName.php +++ b/src/XML/ds/KeyName.php @@ -20,6 +20,5 @@ final class KeyName extends AbstractDsElement implements SchemaValidatableElemen use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/ds/KeyValue.php b/src/XML/ds/KeyValue.php index 0f0a445b..8545613e 100644 --- a/src/XML/ds/KeyValue.php +++ b/src/XML/ds/KeyValue.php @@ -39,7 +39,7 @@ final class KeyValue extends AbstractDsElement implements SchemaValidatableEleme /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -85,7 +85,6 @@ public function getKeyValue(): RSAKeyValue|DSAKeyValue|ECKeyValue|SerializableEl * Convert XML into a KeyValue * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -116,7 +115,6 @@ public static function fromXML(DOMElement $xml): static * Convert this KeyValue element to XML. * * @param \DOMElement|null $parent The element we should append this KeyValue element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/Manifest.php b/src/XML/ds/Manifest.php index 4b565050..873467d9 100644 --- a/src/XML/ds/Manifest.php +++ b/src/XML/ds/Manifest.php @@ -62,7 +62,6 @@ public function getId(): ?IDValue * Convert XML into a Manifest element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -93,7 +92,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Manifest element to XML. * * @param \DOMElement|null $parent The element we should append this Manifest element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/MgmtData.php b/src/XML/ds/MgmtData.php index d65c532b..f232019c 100644 --- a/src/XML/ds/MgmtData.php +++ b/src/XML/ds/MgmtData.php @@ -20,6 +20,5 @@ final class MgmtData extends AbstractDsElement implements SchemaValidatableEleme use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/ds/Modulus.php b/src/XML/ds/Modulus.php index 7354f2fa..1a8a0eb5 100644 --- a/src/XML/ds/Modulus.php +++ b/src/XML/ds/Modulus.php @@ -17,6 +17,5 @@ final class Modulus extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/P.php b/src/XML/ds/P.php index 18f75816..3b716954 100644 --- a/src/XML/ds/P.php +++ b/src/XML/ds/P.php @@ -17,6 +17,5 @@ final class P extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/PGPKeyID.php b/src/XML/ds/PGPKeyID.php index 55f89344..47187728 100644 --- a/src/XML/ds/PGPKeyID.php +++ b/src/XML/ds/PGPKeyID.php @@ -17,6 +17,5 @@ final class PGPKeyID extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/ds/PGPKeyPacket.php b/src/XML/ds/PGPKeyPacket.php index 8dd5ed8f..bb55f53e 100644 --- a/src/XML/ds/PGPKeyPacket.php +++ b/src/XML/ds/PGPKeyPacket.php @@ -17,6 +17,5 @@ final class PGPKeyPacket extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/ds/PgenCounter.php b/src/XML/ds/PgenCounter.php index 2976b367..6b182fa1 100644 --- a/src/XML/ds/PgenCounter.php +++ b/src/XML/ds/PgenCounter.php @@ -17,6 +17,5 @@ final class PgenCounter extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/Q.php b/src/XML/ds/Q.php index 4b310e39..4cf9dff0 100644 --- a/src/XML/ds/Q.php +++ b/src/XML/ds/Q.php @@ -17,6 +17,5 @@ final class Q extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/RSAKeyValue.php b/src/XML/ds/RSAKeyValue.php index e667e92a..d9abe06a 100644 --- a/src/XML/ds/RSAKeyValue.php +++ b/src/XML/ds/RSAKeyValue.php @@ -61,7 +61,6 @@ public function getExponent(): Exponent * Convert XML into a RSAKeyValue * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -107,7 +106,6 @@ public static function fromXML(DOMElement $xml): static * Convert this RSAKeyValue element to XML. * * @param \DOMElement|null $parent The element we should append this RSAKeyValue element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/Reference.php b/src/XML/ds/Reference.php index 74cf1a46..1b96060a 100644 --- a/src/XML/ds/Reference.php +++ b/src/XML/ds/Reference.php @@ -104,8 +104,6 @@ public function getURI(): ?AnyURIValue /** * Determine whether this is an xpointer reference. - * - * @return bool */ public function isXPointer(): bool { @@ -117,7 +115,6 @@ public function isXPointer(): bool * Convert XML into a Reference element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -170,7 +167,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Reference element to XML. * * @param \DOMElement|null $parent The element we should append this Reference element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/RetrievalMethod.php b/src/XML/ds/RetrievalMethod.php index 241a6f6b..fb89479e 100644 --- a/src/XML/ds/RetrievalMethod.php +++ b/src/XML/ds/RetrievalMethod.php @@ -70,7 +70,6 @@ public function getType(): ?AnyURIValue * Convert XML into a RetrievalMethod element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -103,7 +102,6 @@ public static function fromXML(DOMElement $xml): static * Convert this RetrievalMethod element to XML. * * @param \DOMElement|null $parent The element we should append this RetrievalMethod element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/SPKISexp.php b/src/XML/ds/SPKISexp.php index e17578f7..54720dfe 100644 --- a/src/XML/ds/SPKISexp.php +++ b/src/XML/ds/SPKISexp.php @@ -17,6 +17,5 @@ final class SPKISexp extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/ds/Seed.php b/src/XML/ds/Seed.php index 84adca78..60384bcd 100644 --- a/src/XML/ds/Seed.php +++ b/src/XML/ds/Seed.php @@ -17,6 +17,5 @@ final class Seed extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/ds/Signature.php b/src/XML/ds/Signature.php index 228e2ddc..0c6f1f94 100644 --- a/src/XML/ds/Signature.php +++ b/src/XML/ds/Signature.php @@ -101,7 +101,6 @@ public function getObjects(): array * Convert XML into a Signature element * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -163,7 +162,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Signature element to XML. * * @param \DOMElement|null $parent The element we should append this Signature element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/SignatureMethod.php b/src/XML/ds/SignatureMethod.php index f42124c7..1b25ec7e 100644 --- a/src/XML/ds/SignatureMethod.php +++ b/src/XML/ds/SignatureMethod.php @@ -33,7 +33,7 @@ final class SignatureMethod extends AbstractDsElement implements SchemaValidatab /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -88,7 +88,6 @@ public function getHMACOutputLength(): ?HMACOutputLength * Convert XML into a SignatureMethod * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -111,7 +110,6 @@ public static function fromXML(DOMElement $xml): static * Convert this SignatureMethod element to XML. * * @param \DOMElement|null $parent The element we should append this SignatureMethod element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/SignatureProperties.php b/src/XML/ds/SignatureProperties.php index 6253726e..23b55393 100644 --- a/src/XML/ds/SignatureProperties.php +++ b/src/XML/ds/SignatureProperties.php @@ -63,7 +63,6 @@ public function getId(): ?IDValue * Convert XML into a SignatureProperties element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -92,7 +91,6 @@ public static function fromXML(DOMElement $xml): static * Convert this SignatureProperties element to XML. * * @param \DOMElement|null $parent The element we should append this SignatureProperties element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/SignatureProperty.php b/src/XML/ds/SignatureProperty.php index 641fe74c..c1980542 100644 --- a/src/XML/ds/SignatureProperty.php +++ b/src/XML/ds/SignatureProperty.php @@ -29,7 +29,7 @@ final class SignatureProperty extends AbstractDsElement implements SchemaValidat /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -70,7 +70,6 @@ public function getId(): ?IDValue * Convert XML into a SignatureProperty element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -100,7 +99,6 @@ public static function fromXML(DOMElement $xml): static * Convert this SignatureProperty element to XML. * * @param \DOMElement|null $parent The element we should append this SignatureProperty element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/SignatureValue.php b/src/XML/ds/SignatureValue.php index 2da5c33f..877f285a 100644 --- a/src/XML/ds/SignatureValue.php +++ b/src/XML/ds/SignatureValue.php @@ -61,7 +61,6 @@ public function getValue(): Base64BinaryValue * Convert XML into a SignatureValue element * * @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 * Convert this SignatureValue element to XML. * * @param \DOMElement|null $parent The element we should append this SignatureValue element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/SignedInfo.php b/src/XML/ds/SignedInfo.php index bb112d2e..5bb83d1a 100644 --- a/src/XML/ds/SignedInfo.php +++ b/src/XML/ds/SignedInfo.php @@ -33,9 +33,6 @@ final class SignedInfo extends AbstractDsElement implements use SchemaValidatableElementTrait; - /* - * @var DOMElement - */ protected ?DOMElement $xml = null; @@ -119,7 +116,6 @@ protected function getOriginalXML(): DOMElement * Convert XML into a SignedInfo instance * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -181,7 +177,6 @@ public static function fromXML(DOMElement $xml): static * Convert this SignedInfo element to XML. * * @param \DOMElement|null $parent The element we should append this SignedInfo element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/Transform.php b/src/XML/ds/Transform.php index 30124446..af11d5ed 100644 --- a/src/XML/ds/Transform.php +++ b/src/XML/ds/Transform.php @@ -102,7 +102,6 @@ public function getInclusiveNamespaces(): ?InclusiveNamespaces * Convert XML into a Transform element. * * @param \DOMElement $xml The XML element we should load. - * @return static */ public static function fromXML(DOMElement $xml): static { @@ -132,7 +131,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Transform element to XML. * * @param \DOMElement|null $parent The element we should append this Transform element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/Transforms.php b/src/XML/ds/Transforms.php index f797bfd7..dee12fce 100644 --- a/src/XML/ds/Transforms.php +++ b/src/XML/ds/Transforms.php @@ -46,8 +46,6 @@ public function getTransform(): array /** * 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 * Convert XML into a Transforms element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -79,7 +76,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Transforms element to XML. * * @param \DOMElement|null $parent The element we should append this Transforms element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/X509CRL.php b/src/XML/ds/X509CRL.php index a6d97986..72f8b758 100644 --- a/src/XML/ds/X509CRL.php +++ b/src/XML/ds/X509CRL.php @@ -17,6 +17,5 @@ final class X509CRL extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/ds/X509Certificate.php b/src/XML/ds/X509Certificate.php index 0a418d2f..4b62d189 100644 --- a/src/XML/ds/X509Certificate.php +++ b/src/XML/ds/X509Certificate.php @@ -17,6 +17,5 @@ final class X509Certificate extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/ds/X509Data.php b/src/XML/ds/X509Data.php index 7f88c963..1982354e 100644 --- a/src/XML/ds/X509Data.php +++ b/src/XML/ds/X509Data.php @@ -28,10 +28,10 @@ final class X509Data extends AbstractDsElement implements SchemaValidatableEleme /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** The exclusions for the xs:any element */ - public const XS_ANY_ELT_EXCLUSIONS = [ + public const array XS_ANY_ELT_EXCLUSIONS = [ [X509Digest::NS, 'X509Digest'], ]; @@ -98,7 +98,6 @@ public function getData(): array * Convert XML into a X509Data * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -126,7 +125,6 @@ public static function fromXML(DOMElement $xml): static * Convert this X509Data element to XML. * * @param \DOMElement|null $parent The element we should append this X509Data element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/X509IssuerName.php b/src/XML/ds/X509IssuerName.php index 934077ad..05343094 100644 --- a/src/XML/ds/X509IssuerName.php +++ b/src/XML/ds/X509IssuerName.php @@ -17,6 +17,5 @@ final class X509IssuerName extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/ds/X509IssuerSerial.php b/src/XML/ds/X509IssuerSerial.php index c223cab4..570ae234 100644 --- a/src/XML/ds/X509IssuerSerial.php +++ b/src/XML/ds/X509IssuerSerial.php @@ -58,7 +58,6 @@ public function getSerialNumber(): X509SerialNumber * Convert XML into a X509IssuerSerial * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -88,7 +87,6 @@ public static function fromXML(DOMElement $xml): static * Convert this X509IssuerSerial element to XML. * * @param \DOMElement|null $parent The element we should append this X509IssuerSerial element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ds/X509SKI.php b/src/XML/ds/X509SKI.php index da39de3a..ebf2d4fe 100644 --- a/src/XML/ds/X509SKI.php +++ b/src/XML/ds/X509SKI.php @@ -17,6 +17,5 @@ final class X509SKI extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/ds/X509SerialNumber.php b/src/XML/ds/X509SerialNumber.php index d6d413f3..f82ff48b 100644 --- a/src/XML/ds/X509SerialNumber.php +++ b/src/XML/ds/X509SerialNumber.php @@ -17,6 +17,5 @@ final class X509SerialNumber extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = IntegerValue::class; + public const string TEXTCONTENT_TYPE = IntegerValue::class; } diff --git a/src/XML/ds/X509SubjectName.php b/src/XML/ds/X509SubjectName.php index 1f3a7725..ebe0e6b6 100644 --- a/src/XML/ds/X509SubjectName.php +++ b/src/XML/ds/X509SubjectName.php @@ -17,6 +17,5 @@ final class X509SubjectName extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/ds/XPath.php b/src/XML/ds/XPath.php index 0c29cf62..880f261f 100644 --- a/src/XML/ds/XPath.php +++ b/src/XML/ds/XPath.php @@ -44,7 +44,6 @@ public function getExpression(): StringValue * Convert XML into a class instance * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -60,7 +59,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/ds/Y.php b/src/XML/ds/Y.php index 94546dc6..9858b288 100644 --- a/src/XML/ds/Y.php +++ b/src/XML/ds/Y.php @@ -17,6 +17,5 @@ final class Y extends AbstractDsElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/dsig11/A.php b/src/XML/dsig11/A.php index 480c7651..9d776b35 100644 --- a/src/XML/dsig11/A.php +++ b/src/XML/dsig11/A.php @@ -17,6 +17,5 @@ final class A extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/dsig11/AbstractCharTwoFieldParamsType.php b/src/XML/dsig11/AbstractCharTwoFieldParamsType.php index cb3edacb..7bc0b22e 100644 --- a/src/XML/dsig11/AbstractCharTwoFieldParamsType.php +++ b/src/XML/dsig11/AbstractCharTwoFieldParamsType.php @@ -39,7 +39,6 @@ public function getM(): M * Convert this CharTwoFieldParamsType element to XML. * * @param \DOMElement|null $parent The element we should append this CharTwoFieldParamsType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractCurveType.php b/src/XML/dsig11/AbstractCurveType.php index b298a5b9..9e0bb577 100644 --- a/src/XML/dsig11/AbstractCurveType.php +++ b/src/XML/dsig11/AbstractCurveType.php @@ -52,7 +52,6 @@ public function getB(): B * Convert this CurveType element to XML. * * @param \DOMElement|null $parent The element we should append this CurveType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractDsig11Element.php b/src/XML/dsig11/AbstractDsig11Element.php index 8a6907d6..39f33278 100644 --- a/src/XML/dsig11/AbstractDsig11Element.php +++ b/src/XML/dsig11/AbstractDsig11Element.php @@ -14,12 +14,9 @@ */ abstract class AbstractDsig11Element extends AbstractElement { - /** @var string */ - public const NS = C::NS_XDSIG11; + public const string NS = C::NS_XDSIG11; - /** @var string */ - public const NS_PREFIX = 'dsig11'; + public const string NS_PREFIX = 'dsig11'; - /** @var string */ - public const SCHEMA = 'resources/schemas/xmldsig11-schema.xsd'; + public const string SCHEMA = 'resources/schemas/xmldsig11-schema.xsd'; } diff --git a/src/XML/dsig11/AbstractECKeyValueType.php b/src/XML/dsig11/AbstractECKeyValueType.php index 2d540158..7fdbd66c 100644 --- a/src/XML/dsig11/AbstractECKeyValueType.php +++ b/src/XML/dsig11/AbstractECKeyValueType.php @@ -89,7 +89,6 @@ public function getId(): ?IDValue * Convert this ECKeyValueType element to XML. * * @param \DOMElement|null $parent The element we should append this ECKeyValueType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractECParametersType.php b/src/XML/dsig11/AbstractECParametersType.php index b35ca34f..da222385 100644 --- a/src/XML/dsig11/AbstractECParametersType.php +++ b/src/XML/dsig11/AbstractECParametersType.php @@ -104,7 +104,6 @@ public function getValidationData(): ?ValidationData * Convert this ECParametersType element to XML. * * @param \DOMElement|null $parent The element we should append this ECParametersType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractECValidationDataType.php b/src/XML/dsig11/AbstractECValidationDataType.php index 4edae7be..6e64210d 100644 --- a/src/XML/dsig11/AbstractECValidationDataType.php +++ b/src/XML/dsig11/AbstractECValidationDataType.php @@ -55,7 +55,6 @@ public function getHashAlgorithm(): AnyURIValue * Convert this ECValidationDataType element to XML. * * @param \DOMElement|null $parent The element we should append this ECValidationDataType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractFieldIDType.php b/src/XML/dsig11/AbstractFieldIDType.php index 4ad74864..6f3aefc6 100644 --- a/src/XML/dsig11/AbstractFieldIDType.php +++ b/src/XML/dsig11/AbstractFieldIDType.php @@ -27,8 +27,7 @@ abstract class AbstractFieldIDType extends AbstractDsig11Element } - /** @var string */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -75,7 +74,6 @@ public function getFieldId(): Prime|TnB|PnB|GnB|SerializableElementInterface * Convert this FieldIDType element to XML. * * @param \DOMElement|null $parent The element we should append this FieldIDType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractNamedCurveType.php b/src/XML/dsig11/AbstractNamedCurveType.php index 164b751e..da5abe9f 100644 --- a/src/XML/dsig11/AbstractNamedCurveType.php +++ b/src/XML/dsig11/AbstractNamedCurveType.php @@ -42,7 +42,6 @@ public function getURI(): AnyURIValue * Convert this NamedCurveType element to XML. * * @param \DOMElement|null $parent The element we should append this NamedCurveType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractPnBFieldParamsType.php b/src/XML/dsig11/AbstractPnBFieldParamsType.php index e0d1dede..13a8db7b 100644 --- a/src/XML/dsig11/AbstractPnBFieldParamsType.php +++ b/src/XML/dsig11/AbstractPnBFieldParamsType.php @@ -68,7 +68,6 @@ public function getK3(): K3 * Convert this PnBFieldParamsType element to XML. * * @param \DOMElement|null $parent The element we should append this PnBFieldParamsType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractPrimeFieldParamsType.php b/src/XML/dsig11/AbstractPrimeFieldParamsType.php index 8a1ac69b..053de66d 100644 --- a/src/XML/dsig11/AbstractPrimeFieldParamsType.php +++ b/src/XML/dsig11/AbstractPrimeFieldParamsType.php @@ -39,7 +39,6 @@ public function getP(): P * Convert this PrimeFieldParamsType element to XML. * * @param \DOMElement|null $parent The element we should append this PrimeFieldParamsType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/AbstractTnBFieldParamsType.php b/src/XML/dsig11/AbstractTnBFieldParamsType.php index 11171478..59a6af9f 100644 --- a/src/XML/dsig11/AbstractTnBFieldParamsType.php +++ b/src/XML/dsig11/AbstractTnBFieldParamsType.php @@ -42,7 +42,6 @@ public function getK(): K * Convert this TnBFieldParamsType element to XML. * * @param \DOMElement|null $parent The element we should append this TnBFieldParamsType element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/B.php b/src/XML/dsig11/B.php index 7b562231..906e5f90 100644 --- a/src/XML/dsig11/B.php +++ b/src/XML/dsig11/B.php @@ -17,6 +17,5 @@ final class B extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/dsig11/Base.php b/src/XML/dsig11/Base.php index 5da79d96..5b7060a7 100644 --- a/src/XML/dsig11/Base.php +++ b/src/XML/dsig11/Base.php @@ -17,6 +17,5 @@ final class Base extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = ECPointValue::class; + public const string TEXTCONTENT_TYPE = ECPointValue::class; } diff --git a/src/XML/dsig11/CoFactor.php b/src/XML/dsig11/CoFactor.php index 0c788eff..3624383e 100644 --- a/src/XML/dsig11/CoFactor.php +++ b/src/XML/dsig11/CoFactor.php @@ -17,6 +17,5 @@ final class CoFactor extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = IntegerValue::class; + public const string TEXTCONTENT_TYPE = IntegerValue::class; } diff --git a/src/XML/dsig11/Curve.php b/src/XML/dsig11/Curve.php index 20e1e99a..196071fb 100644 --- a/src/XML/dsig11/Curve.php +++ b/src/XML/dsig11/Curve.php @@ -23,7 +23,6 @@ final class Curve extends AbstractCurveType * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/DEREncodedKeyValue.php b/src/XML/dsig11/DEREncodedKeyValue.php index c6f07fed..664acb67 100644 --- a/src/XML/dsig11/DEREncodedKeyValue.php +++ b/src/XML/dsig11/DEREncodedKeyValue.php @@ -65,7 +65,6 @@ public function getId(): ?IDValue * Convert XML into a DEREncodedKeyValue * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -86,7 +85,6 @@ public static function fromXML(DOMElement $xml): static * Convert this DEREncodedKeyValue element to XML. * * @param \DOMElement|null $parent The element we should append this DEREncodedKeyValue element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/ECKeyValue.php b/src/XML/dsig11/ECKeyValue.php index 93c6edb1..151cea10 100644 --- a/src/XML/dsig11/ECKeyValue.php +++ b/src/XML/dsig11/ECKeyValue.php @@ -29,7 +29,6 @@ final class ECKeyValue extends AbstractECKeyValueType implements SchemaValidatab * Convert XML into a ECKeyValue element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/ECParameters.php b/src/XML/dsig11/ECParameters.php index a516cf0a..817fe3c6 100644 --- a/src/XML/dsig11/ECParameters.php +++ b/src/XML/dsig11/ECParameters.php @@ -23,7 +23,6 @@ final class ECParameters extends AbstractECParametersType * Convert XML into a ECParameters element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/FieldID.php b/src/XML/dsig11/FieldID.php index 3e2e683a..7869a2f4 100644 --- a/src/XML/dsig11/FieldID.php +++ b/src/XML/dsig11/FieldID.php @@ -25,7 +25,6 @@ final class FieldID extends AbstractFieldIDType implements SchemaValidatableElem * Convert XML into a FieldID element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/GnB.php b/src/XML/dsig11/GnB.php index d0ee3f71..cc17338c 100644 --- a/src/XML/dsig11/GnB.php +++ b/src/XML/dsig11/GnB.php @@ -28,7 +28,6 @@ final class GnB extends AbstractCharTwoFieldParamsType implements SchemaValidata * Convert XML into a GnB element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/K.php b/src/XML/dsig11/K.php index e655eaa1..7c64e851 100644 --- a/src/XML/dsig11/K.php +++ b/src/XML/dsig11/K.php @@ -17,6 +17,5 @@ final class K extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = PositiveIntegerValue::class; + public const string TEXTCONTENT_TYPE = PositiveIntegerValue::class; } diff --git a/src/XML/dsig11/K1.php b/src/XML/dsig11/K1.php index a7308db5..e70c979f 100644 --- a/src/XML/dsig11/K1.php +++ b/src/XML/dsig11/K1.php @@ -17,6 +17,5 @@ final class K1 extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = PositiveIntegerValue::class; + public const string TEXTCONTENT_TYPE = PositiveIntegerValue::class; } diff --git a/src/XML/dsig11/K2.php b/src/XML/dsig11/K2.php index 9d2df1b9..da984f48 100644 --- a/src/XML/dsig11/K2.php +++ b/src/XML/dsig11/K2.php @@ -17,6 +17,5 @@ final class K2 extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = PositiveIntegerValue::class; + public const string TEXTCONTENT_TYPE = PositiveIntegerValue::class; } diff --git a/src/XML/dsig11/K3.php b/src/XML/dsig11/K3.php index ac8b6018..73c57be5 100644 --- a/src/XML/dsig11/K3.php +++ b/src/XML/dsig11/K3.php @@ -17,6 +17,5 @@ final class K3 extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = PositiveIntegerValue::class; + public const string TEXTCONTENT_TYPE = PositiveIntegerValue::class; } diff --git a/src/XML/dsig11/KeyInfoReference.php b/src/XML/dsig11/KeyInfoReference.php index 947b7763..78634a17 100644 --- a/src/XML/dsig11/KeyInfoReference.php +++ b/src/XML/dsig11/KeyInfoReference.php @@ -61,7 +61,6 @@ public function getId(): ?IDValue * Convert XML into a KeyInfoReference * * @param \DOMElement $xml The XML element we should load - * @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 * Convert this KeyInfoReference element to XML. * * @param \DOMElement|null $parent The element we should append this KeyInfoReference element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/dsig11/M.php b/src/XML/dsig11/M.php index 112e49b1..34c812c4 100644 --- a/src/XML/dsig11/M.php +++ b/src/XML/dsig11/M.php @@ -17,6 +17,5 @@ final class M extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = PositiveIntegerValue::class; + public const string TEXTCONTENT_TYPE = PositiveIntegerValue::class; } diff --git a/src/XML/dsig11/NamedCurve.php b/src/XML/dsig11/NamedCurve.php index d0e39d4c..fb9cabde 100644 --- a/src/XML/dsig11/NamedCurve.php +++ b/src/XML/dsig11/NamedCurve.php @@ -20,7 +20,6 @@ final class NamedCurve extends AbstractNamedCurveType * Convert XML into a NamedCurve element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/Order.php b/src/XML/dsig11/Order.php index af537662..d3b5a78a 100644 --- a/src/XML/dsig11/Order.php +++ b/src/XML/dsig11/Order.php @@ -17,6 +17,5 @@ final class Order extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/dsig11/P.php b/src/XML/dsig11/P.php index 55ebfd1a..37342090 100644 --- a/src/XML/dsig11/P.php +++ b/src/XML/dsig11/P.php @@ -17,6 +17,5 @@ final class P extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/dsig11/PnB.php b/src/XML/dsig11/PnB.php index a1bf6d0a..eb0018e1 100644 --- a/src/XML/dsig11/PnB.php +++ b/src/XML/dsig11/PnB.php @@ -28,7 +28,6 @@ final class PnB extends AbstractPnBFieldParamsType implements SchemaValidatableE * Convert XML into a PnB element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/Prime.php b/src/XML/dsig11/Prime.php index 1b27605e..179919f1 100644 --- a/src/XML/dsig11/Prime.php +++ b/src/XML/dsig11/Prime.php @@ -28,7 +28,6 @@ final class Prime extends AbstractPrimeFieldParamsType implements SchemaValidata * Convert XML into a Prime element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/PublicKey.php b/src/XML/dsig11/PublicKey.php index ae7be1f3..39fa2e53 100644 --- a/src/XML/dsig11/PublicKey.php +++ b/src/XML/dsig11/PublicKey.php @@ -17,6 +17,5 @@ final class PublicKey extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = ECPointValue::class; + public const string TEXTCONTENT_TYPE = ECPointValue::class; } diff --git a/src/XML/dsig11/Seed.php b/src/XML/dsig11/Seed.php index 3551fd1e..ba672d36 100644 --- a/src/XML/dsig11/Seed.php +++ b/src/XML/dsig11/Seed.php @@ -17,9 +17,7 @@ final class Seed extends AbstractDsig11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; - /** @var string */ - public const LOCALNAME = 'seed'; + public const string LOCALNAME = 'seed'; } diff --git a/src/XML/dsig11/TnB.php b/src/XML/dsig11/TnB.php index e45a79cd..42697dd1 100644 --- a/src/XML/dsig11/TnB.php +++ b/src/XML/dsig11/TnB.php @@ -28,7 +28,6 @@ final class TnB extends AbstractTnBFieldParamsType implements SchemaValidatableE * Convert XML into a TnB element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/ValidationData.php b/src/XML/dsig11/ValidationData.php index af223b1c..64e95615 100644 --- a/src/XML/dsig11/ValidationData.php +++ b/src/XML/dsig11/ValidationData.php @@ -29,7 +29,6 @@ final class ValidationData extends AbstractECValidationDataType implements Schem * Convert XML into a ValidationData element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/dsig11/X509Digest.php b/src/XML/dsig11/X509Digest.php index c1cf5939..c395f3dc 100644 --- a/src/XML/dsig11/X509Digest.php +++ b/src/XML/dsig11/X509Digest.php @@ -71,7 +71,6 @@ public function getAlgorithm(): AnyURIValue * Convert XML into a X509Digest * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -92,7 +91,6 @@ public static function fromXML(DOMElement $xml): static * Convert this X509Digest element to XML. * * @param \DOMElement|null $parent The element we should append this X509Digest element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/ec/AbstractEcElement.php b/src/XML/ec/AbstractEcElement.php index 98a23823..4092d98f 100644 --- a/src/XML/ec/AbstractEcElement.php +++ b/src/XML/ec/AbstractEcElement.php @@ -14,12 +14,9 @@ */ abstract class AbstractEcElement extends AbstractElement { - /** @var string */ - public const NS = C::C14N_EXCLUSIVE_WITHOUT_COMMENTS; + public const string NS = C::C14N_EXCLUSIVE_WITHOUT_COMMENTS; - /** @var string */ - public const NS_PREFIX = 'ec'; + public const string NS_PREFIX = 'ec'; - /** @var string */ - public const SCHEMA = 'resources/schemas/exc-c14n.xsd'; + public const string SCHEMA = 'resources/schemas/exc-c14n.xsd'; } diff --git a/src/XML/ec/InclusiveNamespaces.php b/src/XML/ec/InclusiveNamespaces.php index d6c7af37..a8c5a9fc 100644 --- a/src/XML/ec/InclusiveNamespaces.php +++ b/src/XML/ec/InclusiveNamespaces.php @@ -47,7 +47,6 @@ public function getPrefixes(): ?NMTokensValue * Convert XML into an InclusiveNamespaces element. * * @param \DOMElement $xml The XML element we should load. - * @return static */ public static function fromXML(DOMElement $xml): static { @@ -61,7 +60,6 @@ public static function fromXML(DOMElement $xml): static * Convert this InclusiveNamespaces to XML. * * @param \DOMElement|null $parent The element we should append this InclusiveNamespaces to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc/AbstractAgreementMethodType.php b/src/XML/xenc/AbstractAgreementMethodType.php index d34e0b88..94180e46 100644 --- a/src/XML/xenc/AbstractAgreementMethodType.php +++ b/src/XML/xenc/AbstractAgreementMethodType.php @@ -29,7 +29,7 @@ abstract class AbstractAgreementMethodType extends AbstractXencElement implement /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -100,7 +100,6 @@ public function getRecipientKeyInfo(): ?RecipientKeyInfo * Initialize an AgreementMethod object from an existing XML. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -139,7 +138,6 @@ public static function fromXML(DOMElement $xml): static * Convert this AgreementMethod object to XML. * * @param \DOMElement|null $parent The element we should append this AgreementMethod to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc/AbstractDHKeyValueType.php b/src/XML/xenc/AbstractDHKeyValueType.php index 84b28a1d..cd92c669 100644 --- a/src/XML/xenc/AbstractDHKeyValueType.php +++ b/src/XML/xenc/AbstractDHKeyValueType.php @@ -127,7 +127,6 @@ public function getPgenCounter(): ?PgenCounter * Initialize an DHKeyValue object from an existing XML. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -175,7 +174,6 @@ public static function fromXML(DOMElement $xml): static * Convert this DHKeyValue object to XML. * * @param \DOMElement|null $parent The element we should append this DHKeyValue to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc/AbstractEncryptedType.php b/src/XML/xenc/AbstractEncryptedType.php index 4008b737..0efd0294 100644 --- a/src/XML/xenc/AbstractEncryptedType.php +++ b/src/XML/xenc/AbstractEncryptedType.php @@ -15,8 +15,6 @@ /** * Abstract class representing encrypted data. * - * Note: elements are not supported. - * * @package simplesamlphp/xml-security */ abstract class AbstractEncryptedType extends AbstractXencElement diff --git a/src/XML/xenc/AbstractEncryptionMethod.php b/src/XML/xenc/AbstractEncryptionMethod.php index 49debb01..f386ddae 100644 --- a/src/XML/xenc/AbstractEncryptionMethod.php +++ b/src/XML/xenc/AbstractEncryptionMethod.php @@ -26,7 +26,7 @@ abstract class AbstractEncryptionMethod extends AbstractXencElement /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** @@ -84,7 +84,6 @@ public function getOAEPParams(): ?OAEPparams * Initialize an EncryptionMethod object from an existing XML. * * @param \DOMElement $xml - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -117,7 +116,6 @@ public static function fromXML(DOMElement $xml): static * Convert this EncryptionMethod object to XML. * * @param \DOMElement|null $parent The element we should append this EncryptionMethod to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc/AbstractEncryptionPropertyType.php b/src/XML/xenc/AbstractEncryptionPropertyType.php index fd6bbef2..01d4e8ca 100644 --- a/src/XML/xenc/AbstractEncryptionPropertyType.php +++ b/src/XML/xenc/AbstractEncryptionPropertyType.php @@ -33,10 +33,10 @@ abstract class AbstractEncryptionPropertyType extends AbstractXencElement implem /** The namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = [C::NS_XML]; + public const array XS_ANY_ATTR_NAMESPACE = [C::NS_XML]; /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** diff --git a/src/XML/xenc/AbstractReference.php b/src/XML/xenc/AbstractReference.php index cd0dd470..568ba564 100644 --- a/src/XML/xenc/AbstractReference.php +++ b/src/XML/xenc/AbstractReference.php @@ -24,7 +24,7 @@ abstract class AbstractReference extends AbstractXencElement /** The namespace-attribute for the xs:any element */ - public const XS_ANY_ELT_NAMESPACE = NS::OTHER; + public const string XS_ANY_ELT_NAMESPACE = NS::OTHER; /** diff --git a/src/XML/xenc/AbstractXencElement.php b/src/XML/xenc/AbstractXencElement.php index 33444945..bb5ff1ad 100644 --- a/src/XML/xenc/AbstractXencElement.php +++ b/src/XML/xenc/AbstractXencElement.php @@ -14,12 +14,9 @@ */ abstract class AbstractXencElement extends AbstractElement { - /** @var string */ - public const NS = C::NS_XENC; + public const string NS = C::NS_XENC; - /** @var string */ - public const NS_PREFIX = 'xenc'; + public const string NS_PREFIX = 'xenc'; - /** @var string */ - public const SCHEMA = 'resources/schemas/xenc-schema.xsd'; + public const string SCHEMA = 'resources/schemas/xenc-schema.xsd'; } diff --git a/src/XML/xenc/CarriedKeyName.php b/src/XML/xenc/CarriedKeyName.php index 7051f395..7daa1815 100644 --- a/src/XML/xenc/CarriedKeyName.php +++ b/src/XML/xenc/CarriedKeyName.php @@ -17,6 +17,5 @@ final class CarriedKeyName extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/xenc/CipherValue.php b/src/XML/xenc/CipherValue.php index c2267fbc..96e48ad1 100644 --- a/src/XML/xenc/CipherValue.php +++ b/src/XML/xenc/CipherValue.php @@ -17,6 +17,5 @@ final class CipherValue extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/xenc/Generator.php b/src/XML/xenc/Generator.php index b7ad02de..553a4036 100644 --- a/src/XML/xenc/Generator.php +++ b/src/XML/xenc/Generator.php @@ -17,6 +17,5 @@ final class Generator extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/xenc/KANonce.php b/src/XML/xenc/KANonce.php index f0bd9f2a..1b51925b 100644 --- a/src/XML/xenc/KANonce.php +++ b/src/XML/xenc/KANonce.php @@ -17,9 +17,7 @@ final class KANonce extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; - /** @var string */ - public const LOCALNAME = 'KA-Nonce'; + public const string LOCALNAME = 'KA-Nonce'; } diff --git a/src/XML/xenc/KeySize.php b/src/XML/xenc/KeySize.php index 0f30fd7d..bb8ef957 100644 --- a/src/XML/xenc/KeySize.php +++ b/src/XML/xenc/KeySize.php @@ -17,6 +17,5 @@ final class KeySize extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = KeySizeValue::class; + public const string TEXTCONTENT_TYPE = KeySizeValue::class; } diff --git a/src/XML/xenc/OAEPparams.php b/src/XML/xenc/OAEPparams.php index ca81f391..18e9700b 100644 --- a/src/XML/xenc/OAEPparams.php +++ b/src/XML/xenc/OAEPparams.php @@ -17,6 +17,5 @@ final class OAEPparams extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/src/XML/xenc/OriginatorKeyInfo.php b/src/XML/xenc/OriginatorKeyInfo.php index 96a56c72..f07f6cc4 100644 --- a/src/XML/xenc/OriginatorKeyInfo.php +++ b/src/XML/xenc/OriginatorKeyInfo.php @@ -27,18 +27,15 @@ */ final class OriginatorKeyInfo extends AbstractKeyInfoType { - /** @var string */ - public const NS = C::NS_XENC; + public const string NS = C::NS_XENC; - /** @var string */ - public const NS_PREFIX = 'xenc'; + public const string NS_PREFIX = 'xenc'; /** * Convert XML into a OriginatorKeyInfo * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/xenc/P.php b/src/XML/xenc/P.php index f45c1149..936595d0 100644 --- a/src/XML/xenc/P.php +++ b/src/XML/xenc/P.php @@ -17,6 +17,5 @@ final class P extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/xenc/PgenCounter.php b/src/XML/xenc/PgenCounter.php index e6b62439..d80a7bce 100644 --- a/src/XML/xenc/PgenCounter.php +++ b/src/XML/xenc/PgenCounter.php @@ -17,9 +17,7 @@ final class PgenCounter extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; - /** @var string */ - public const LOCALNAME = 'pgenCounter'; + public const string LOCALNAME = 'pgenCounter'; } diff --git a/src/XML/xenc/Q.php b/src/XML/xenc/Q.php index 152ac894..ed8ba0f0 100644 --- a/src/XML/xenc/Q.php +++ b/src/XML/xenc/Q.php @@ -17,6 +17,5 @@ final class Q extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; } diff --git a/src/XML/xenc/RecipientKeyInfo.php b/src/XML/xenc/RecipientKeyInfo.php index e248b196..bef1f1e2 100644 --- a/src/XML/xenc/RecipientKeyInfo.php +++ b/src/XML/xenc/RecipientKeyInfo.php @@ -27,18 +27,15 @@ */ final class RecipientKeyInfo extends AbstractKeyInfoType { - /** @var string */ - public const NS = C::NS_XENC; + public const string NS = C::NS_XENC; - /** @var string */ - public const NS_PREFIX = 'xenc'; + public const string NS_PREFIX = 'xenc'; /** * Convert XML into a RecipientKeyInfo * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong diff --git a/src/XML/xenc/Seed.php b/src/XML/xenc/Seed.php index 7f8e647c..9f9a81ce 100644 --- a/src/XML/xenc/Seed.php +++ b/src/XML/xenc/Seed.php @@ -17,9 +17,7 @@ final class Seed extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; - /** @var string */ - public const LOCALNAME = 'seed'; + public const string LOCALNAME = 'seed'; } diff --git a/src/XML/xenc/Transforms.php b/src/XML/xenc/Transforms.php index f9fd4a6f..80c1b6f0 100644 --- a/src/XML/xenc/Transforms.php +++ b/src/XML/xenc/Transforms.php @@ -42,8 +42,6 @@ public function getTransform(): array /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -55,7 +53,6 @@ public function isEmptyElement(): bool * Convert XML into a Transforms element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -75,7 +72,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Transforms element to XML. * * @param \DOMElement|null $parent The element we should append this Transforms element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc/XencPublic.php b/src/XML/xenc/XencPublic.php index d74024ac..9411bbc5 100644 --- a/src/XML/xenc/XencPublic.php +++ b/src/XML/xenc/XencPublic.php @@ -17,9 +17,7 @@ final class XencPublic extends AbstractXencElement use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = CryptoBinaryValue::class; + public const string TEXTCONTENT_TYPE = CryptoBinaryValue::class; - /** @var string */ - public const LOCALNAME = 'Public'; + public const string LOCALNAME = 'Public'; } diff --git a/src/XML/xenc11/AbstractDerivedKeyType.php b/src/XML/xenc11/AbstractDerivedKeyType.php index d3eed599..da24ab1f 100644 --- a/src/XML/xenc11/AbstractDerivedKeyType.php +++ b/src/XML/xenc11/AbstractDerivedKeyType.php @@ -131,8 +131,6 @@ public function getMasterKeyName(): ?MasterKeyName /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { diff --git a/src/XML/xenc11/AbstractKeyDerivationMethodType.php b/src/XML/xenc11/AbstractKeyDerivationMethodType.php index c643f1ed..080315e0 100644 --- a/src/XML/xenc11/AbstractKeyDerivationMethodType.php +++ b/src/XML/xenc11/AbstractKeyDerivationMethodType.php @@ -28,7 +28,7 @@ abstract class AbstractKeyDerivationMethodType extends AbstractXenc11Element imp /** 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; /** diff --git a/src/XML/xenc11/AbstractXenc11Element.php b/src/XML/xenc11/AbstractXenc11Element.php index 3abe9ef7..dedc9245 100644 --- a/src/XML/xenc11/AbstractXenc11Element.php +++ b/src/XML/xenc11/AbstractXenc11Element.php @@ -14,12 +14,9 @@ */ abstract class AbstractXenc11Element extends AbstractElement { - /** @var string */ - public const NS = C::NS_XENC11; + public const string NS = C::NS_XENC11; - /** @var string */ - public const NS_PREFIX = 'xenc11'; + public const string NS_PREFIX = 'xenc11'; - /** @var string */ - public const SCHEMA = 'resources/schemas/xenc-schema-11.xsd'; + public const string SCHEMA = 'resources/schemas/xenc-schema-11.xsd'; } diff --git a/src/XML/xenc11/DerivedKeyName.php b/src/XML/xenc11/DerivedKeyName.php index 7a129012..b8b54317 100644 --- a/src/XML/xenc11/DerivedKeyName.php +++ b/src/XML/xenc11/DerivedKeyName.php @@ -17,6 +17,5 @@ final class DerivedKeyName extends AbstractXenc11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/xenc11/IterationCount.php b/src/XML/xenc11/IterationCount.php index 6e0fdfa6..3eb594cb 100644 --- a/src/XML/xenc11/IterationCount.php +++ b/src/XML/xenc11/IterationCount.php @@ -40,7 +40,6 @@ public function getIterationCount(): PositiveIntegerValue * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -60,7 +59,6 @@ public static function fromXML(DOMElement $xml): static * Convert this element to XML. * * @param \DOMElement|null $parent The element we should append this element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc11/KeyLength.php b/src/XML/xenc11/KeyLength.php index 0cd02282..f189ae34 100644 --- a/src/XML/xenc11/KeyLength.php +++ b/src/XML/xenc11/KeyLength.php @@ -40,7 +40,6 @@ public function getKeyLength(): PositiveIntegerValue * Convert XML into a class instance * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong @@ -60,7 +59,6 @@ public static function fromXML(DOMElement $xml): static * Convert this element to XML. * * @param \DOMElement|null $parent The element we should append this element to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc11/MasterKeyName.php b/src/XML/xenc11/MasterKeyName.php index 1fcbc548..fdaee6c6 100644 --- a/src/XML/xenc11/MasterKeyName.php +++ b/src/XML/xenc11/MasterKeyName.php @@ -17,6 +17,5 @@ final class MasterKeyName extends AbstractXenc11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = StringValue::class; + public const string TEXTCONTENT_TYPE = StringValue::class; } diff --git a/src/XML/xenc11/PBKDF2params.php b/src/XML/xenc11/PBKDF2params.php index 72c77c7b..915f19d8 100644 --- a/src/XML/xenc11/PBKDF2params.php +++ b/src/XML/xenc11/PBKDF2params.php @@ -11,6 +11,5 @@ */ final class PBKDF2params extends AbstractPBKDF2ParameterType { - /** @var string */ - public const LOCALNAME = 'PBKDF2-params'; + public const string LOCALNAME = 'PBKDF2-params'; } diff --git a/src/XML/xenc11/Parameters.php b/src/XML/xenc11/Parameters.php index 575dd55c..599f03e7 100644 --- a/src/XML/xenc11/Parameters.php +++ b/src/XML/xenc11/Parameters.php @@ -23,10 +23,10 @@ final class Parameters extends AbstractXenc11Element /** 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 namespace-attribute for the xs:anyAttribute element */ - public const XS_ANY_ATTR_NAMESPACE = NS::ANY; + public const string XS_ANY_ATTR_NAMESPACE = NS::ANY; /** @@ -44,8 +44,6 @@ public function __construct(array $elements = [], array $attributes = []) /** * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool */ public function isEmptyElement(): bool { @@ -58,7 +56,6 @@ public function isEmptyElement(): bool * Convert XML into a Parameters element * * @param \DOMElement $xml The XML element we should load - * @return static * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong @@ -79,7 +76,6 @@ public static function fromXML(DOMElement $xml): static * Convert this Parameters element to XML. * * @param \DOMElement|null $parent The element we should append this Parameters to. - * @return \DOMElement */ public function toXML(?DOMElement $parent = null): DOMElement { diff --git a/src/XML/xenc11/Specified.php b/src/XML/xenc11/Specified.php index ce398588..e790956f 100644 --- a/src/XML/xenc11/Specified.php +++ b/src/XML/xenc11/Specified.php @@ -17,6 +17,5 @@ final class Specified extends AbstractXenc11Element use TypedTextContentTrait; - /** @var string */ - public const TEXTCONTENT_TYPE = Base64BinaryValue::class; + public const string TEXTCONTENT_TYPE = Base64BinaryValue::class; } diff --git a/tests/Alg/KeyTransport/RSAKeyTransportTest.php b/tests/Alg/KeyTransport/RSAKeyTransportTest.php index e7f8f2c4..01e6ba69 100644 --- a/tests/Alg/KeyTransport/RSAKeyTransportTest.php +++ b/tests/Alg/KeyTransport/RSAKeyTransportTest.php @@ -18,8 +18,7 @@ */ class RSAKeyTransportTest extends TestCase { - /** @var string */ - public const PLAINTEXT = 'plaintext'; + public const string PLAINTEXT = 'plaintext'; /** @var \SimpleSAML\XMLSecurity\Key\PrivateKey */ diff --git a/tests/Alg/Signature/HMACSignatureTest.php b/tests/Alg/Signature/HMACSignatureTest.php index 092719bb..737cbf76 100644 --- a/tests/Alg/Signature/HMACSignatureTest.php +++ b/tests/Alg/Signature/HMACSignatureTest.php @@ -19,11 +19,9 @@ */ final class HMACSignatureTest extends TestCase { - /** @var string */ - protected const PLAINTEXT = 'plaintext'; + protected const string PLAINTEXT = 'plaintext'; - /** @var string */ - protected const SECRET = 'de54fbd0f10c34df6e800b11043024fa'; + protected const string SECRET = 'de54fbd0f10c34df6e800b11043024fa'; /** @var \SimpleSAML\XMLSecurity\Alg\Signature\SignatureAlgorithmFactory */ diff --git a/tests/Alg/Signature/RSASignatureTest.php b/tests/Alg/Signature/RSASignatureTest.php index bb46867b..4892a294 100644 --- a/tests/Alg/Signature/RSASignatureTest.php +++ b/tests/Alg/Signature/RSASignatureTest.php @@ -21,8 +21,7 @@ */ final class RSASignatureTest extends TestCase { - /** @var string */ - protected const PLAINTEXT = 'plaintext'; + protected const string PLAINTEXT = 'plaintext'; /** @var \SimpleSAML\XMLSecurity\Key\PrivateKey */ diff --git a/tests/Backend/HMACTest.php b/tests/Backend/HMACTest.php index afd27257..7ce7f3c0 100644 --- a/tests/Backend/HMACTest.php +++ b/tests/Backend/HMACTest.php @@ -20,11 +20,11 @@ */ final class HMACTest extends TestCase { - public const PLAINTEXT = "plaintext"; + public const string PLAINTEXT = "plaintext"; - public const SIGNATURE = "61b85d9e800ed0eca556a304cc9e1ac7ae8eecb3"; + public const string SIGNATURE = "61b85d9e800ed0eca556a304cc9e1ac7ae8eecb3"; - public const SECRET = 'secret key'; + public const string SECRET = 'secret key'; /** @var \SimpleSAML\XMLSecurity\Key\SymmetricKey */ diff --git a/tests/Backend/OpenSSLTest.php b/tests/Backend/OpenSSLTest.php index d6d79dc5..57ea6808 100644 --- a/tests/Backend/OpenSSLTest.php +++ b/tests/Backend/OpenSSLTest.php @@ -25,8 +25,7 @@ */ final class OpenSSLTest extends TestCase { - /** @var string */ - protected const VALIDSIG = + protected const string VALIDSIG = 'cdd80e925e509f954807448217157367c00f7ff53c5eec74ea51ef5fee48a048283b37639c7f43400631fa2b9063a1ed057' . '104721887a10ad62f128c26e01f363538a84ad261f40b80df86de9cc920d1dce2c27058da81d9c7aa0e68e459ab94995e27' . 'e57d183ff08188b338f7975681ad67b1b6f8d174b57b666f787b801df9511d7a90e90e9af2386f4051669a4763ce5e9720f' . diff --git a/tests/XML/CustomSignable.php b/tests/XML/CustomSignable.php index 6108034a..c31e9974 100644 --- a/tests/XML/CustomSignable.php +++ b/tests/XML/CustomSignable.php @@ -34,14 +34,11 @@ class CustomSignable extends AbstractElement implements use EncryptableElementTrait; - /** @var string */ - public const NS = 'urn:x-simplesamlphp:namespace'; + public const string NS = 'urn:x-simplesamlphp:namespace'; - /** @var string */ - public const NS_PREFIX = 'ssp'; + public const string NS_PREFIX = 'ssp'; - /** @var bool */ protected bool $formatOutput = false; /** @var \SimpleSAML\XMLSecurity\XML\ds\Signature|null */ diff --git a/tests/XML/EncryptedCustom.php b/tests/XML/EncryptedCustom.php index 03869aaa..3b22785f 100644 --- a/tests/XML/EncryptedCustom.php +++ b/tests/XML/EncryptedCustom.php @@ -37,11 +37,9 @@ final class EncryptedCustom extends AbstractElement implements EncryptedElementI } - /** @var string */ - public const NS = 'urn:ssp:custom'; + public const string NS = 'urn:ssp:custom'; - /** @var string */ - public const NS_PREFIX = 'ssp'; + public const string NS_PREFIX = 'ssp'; /** @var \SimpleSAML\XMLSecurity\Backend\EncryptionBackend|null $backend */ diff --git a/tests/XML/EncryptedCustomTest.php b/tests/XML/EncryptedCustomTest.php index 288cb0bd..fefdbc25 100644 --- a/tests/XML/EncryptedCustomTest.php +++ b/tests/XML/EncryptedCustomTest.php @@ -26,7 +26,6 @@ */ class EncryptedCustomTest extends TestCase { - /** @var \DOMElement */ private DOMElement $signableDocument; /** @var \SimpleSAML\XMLSecurity\Key\PrivateKey */ diff --git a/tests/XML/SignableElementTest.php b/tests/XML/SignableElementTest.php index 60e90fa1..7472c752 100644 --- a/tests/XML/SignableElementTest.php +++ b/tests/XML/SignableElementTest.php @@ -37,13 +37,11 @@ final class SignableElementTest extends TestCase use SerializableElementTestTrait; - /** @var string */ private static string $certificate; /** @var \SimpleSAML\XMLSecurity\Key\PrivateKey */ private static PrivateKey $key; - /** @var \DOMDocument */ private static DOMDocument $signed; diff --git a/tests/XML/SignedElementTest.php b/tests/XML/SignedElementTest.php index e2181f49..5bfd2ec8 100644 --- a/tests/XML/SignedElementTest.php +++ b/tests/XML/SignedElementTest.php @@ -34,13 +34,10 @@ final class SignedElementTest extends TestCase /** @var \SimpleSAML\XMLSecurity\CryptoEncoding\PEM */ private PEM $wrong_certificate; - /** @var \DOMElement */ private DOMElement $signedDocumentWithComments; - /** @var \DOMElement */ private DOMElement $signedDocument; - /** @var \DOMElement */ private DOMElement $tamperedDocument;