From 0b10c8b53366729417d6226ae89a665f9e2d61b6 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Sat, 30 Mar 2024 19:03:49 +0100 Subject: [PATCH 1/3] Bugs/rsapss ssa oid (#54) * Add RSASSA-PSS encryption algorithm support Implemented support for the RSASSA-PSS encryption algorithm which involved adding new Classes and modifying existing ones. The RSAPSSSSAEncryptionAlgorithmIdentifier and RSASSAPSSPrivateKey Classes were added while the OneAsymmetricKey Class was updated to recognize the RSASSA-PSS encryption. This enhances compatibility with a wider range of RSA key types. * Update phpstan baseline file A new phpstan baseline rule has been added for the RSAPSSSSAEncryptionAlgorithmIdentifier class. This update aligns with the addition of the RSASSA-PSS encryption algorithm functionality, and improves the static code analysis and detection of potential issues. --- phpstan-baseline.neon | 5 + ...RSAPSSSSAEncryptionAlgorithmIdentifier.php | 63 +++++ .../Asymmetric/OneAsymmetricKey.php | 7 +- .../Asymmetric/RSA/RSASSAPSSPrivateKey.php | 226 ++++++++++++++++++ 4 files changed, 299 insertions(+), 2 deletions(-) create mode 100644 src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php create mode 100644 src/CryptoTypes/Asymmetric/RSA/RSASSAPSSPrivateKey.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0d8111a..5fd2f56 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -115,6 +115,11 @@ parameters: count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php + - + message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Asymmetric\\\\RSAPSSSSAEncryptionAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + count: 1 + path: src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php + - message: "#^Parameter \\#2 \\$initializationVector of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:__construct\\(\\) expects string, string\\|null given\\.$#" count: 1 diff --git a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php new file mode 100644 index 0000000..34aebd0 --- /dev/null +++ b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php @@ -0,0 +1,63 @@ +asNull(); + return self::create(); + } + + /** + * @return NullType + */ + protected function paramsASN1(): ?Element + { + return NullType::create(); + } +} diff --git a/src/CryptoTypes/Asymmetric/OneAsymmetricKey.php b/src/CryptoTypes/Asymmetric/OneAsymmetricKey.php index ec231a2..f7f29bf 100644 --- a/src/CryptoTypes/Asymmetric/OneAsymmetricKey.php +++ b/src/CryptoTypes/Asymmetric/OneAsymmetricKey.php @@ -24,6 +24,7 @@ use SpomkyLabs\Pki\CryptoTypes\Asymmetric\RFC8410\Curve448\Ed448PrivateKey; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\RFC8410\Curve448\X448PrivateKey; use SpomkyLabs\Pki\CryptoTypes\Asymmetric\RSA\RSAPrivateKey; +use SpomkyLabs\Pki\CryptoTypes\Asymmetric\RSA\RSASSAPSSPrivateKey; use UnexpectedValueException; use function in_array; @@ -181,10 +182,12 @@ public function privateKey(): PrivateKey { $algo = $this->algorithmIdentifier(); switch ($algo->oid()) { - // RSA (including RSASSA-PSS) + // RSA case AlgorithmIdentifier::OID_RSA_ENCRYPTION: - case AlgorithmIdentifier::OID_RSASSA_PSS_ENCRYPTION: return RSAPrivateKey::fromDER($this->privateKeyData); + // RSASSA-PSS + case AlgorithmIdentifier::OID_RSASSA_PSS_ENCRYPTION: + return RSASSAPSSPrivateKey::fromDER($this->privateKeyData); // elliptic curve case AlgorithmIdentifier::OID_EC_PUBLIC_KEY: $pk = ECPrivateKey::fromDER($this->privateKeyData); diff --git a/src/CryptoTypes/Asymmetric/RSA/RSASSAPSSPrivateKey.php b/src/CryptoTypes/Asymmetric/RSA/RSASSAPSSPrivateKey.php new file mode 100644 index 0000000..89703e8 --- /dev/null +++ b/src/CryptoTypes/Asymmetric/RSA/RSASSAPSSPrivateKey.php @@ -0,0 +1,226 @@ +at(0) + ->asInteger() + ->intNumber(); + if ($version !== 0) { + throw new UnexpectedValueException('Version must be 0.'); + } + // helper function get integer from given index + $get_int = static fn ($idx) => $seq->at($idx) + ->asInteger() + ->number(); + $n = $get_int(1); + $e = $get_int(2); + $d = $get_int(3); + $p = $get_int(4); + $q = $get_int(5); + $dp = $get_int(6); + $dq = $get_int(7); + $qi = $get_int(8); + return self::create($n, $e, $d, $p, $q, $dp, $dq, $qi); + } + + /** + * Initialize from DER data. + */ + public static function fromDER(string $data): self + { + return self::fromASN1(UnspecifiedType::fromDER($data)->asSequence()); + } + + /** + * @see PrivateKey::fromPEM() + */ + public static function fromPEM(PEM $pem): self + { + $pk = parent::fromPEM($pem); + if (! ($pk instanceof self)) { + throw new UnexpectedValueException('Not an RSA private key.'); + } + return $pk; + } + + /** + * Get modulus. + * + * @return string Base 10 integer + */ + public function modulus(): string + { + return $this->modulus; + } + + /** + * Get public exponent. + * + * @return string Base 10 integer + */ + public function publicExponent(): string + { + return $this->publicExponent; + } + + /** + * Get private exponent. + * + * @return string Base 10 integer + */ + public function privateExponent(): string + { + return $this->privateExponent; + } + + /** + * Get first prime factor. + * + * @return string Base 10 integer + */ + public function prime1(): string + { + return $this->prime1; + } + + /** + * Get second prime factor. + * + * @return string Base 10 integer + */ + public function prime2(): string + { + return $this->prime2; + } + + /** + * Get first factor exponent. + * + * @return string Base 10 integer + */ + public function exponent1(): string + { + return $this->exponent1; + } + + /** + * Get second factor exponent. + * + * @return string Base 10 integer + */ + public function exponent2(): string + { + return $this->exponent2; + } + + /** + * Get CRT coefficient of the second factor. + * + * @return string Base 10 integer + */ + public function coefficient(): string + { + return $this->coefficient; + } + + public function algorithmIdentifier(): AlgorithmIdentifierType + { + return RSAPSSSSAEncryptionAlgorithmIdentifier::create(); + } + + /** + * @return RSAPublicKey + */ + public function publicKey(): PublicKey + { + return RSAPublicKey::create($this->modulus, $this->publicExponent); + } + + /** + * Generate ASN.1 structure. + */ + public function toASN1(): Sequence + { + return Sequence::create( + Integer::create(0), + Integer::create($this->modulus), + Integer::create($this->publicExponent), + Integer::create($this->privateExponent), + Integer::create($this->prime1), + Integer::create($this->prime2), + Integer::create($this->exponent1), + Integer::create($this->exponent2), + Integer::create($this->coefficient) + ); + } + + public function toDER(): string + { + return $this->toASN1() + ->toDER(); + } + + public function toPEM(): PEM + { + return PEM::create(PEM::TYPE_PRIVATE_KEY, $this->toDER()); + } +} From 4a4c785d45c048c97a139b594b65990299d64add Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 3 Jan 2025 21:22:30 +1300 Subject: [PATCH 2/3] Make nullable parameters explicity nullable for PHP 8.4 (#59) --- src/ASN1/Component/Identifier.php | 2 +- src/ASN1/Component/Length.php | 4 ++-- src/ASN1/Element.php | 2 +- tests/CryptoTypes/Unit/AlgoId/AlgorithmIdentifierTest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Asymmetric/ECPKAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Asymmetric/RSAEncAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Cipher/AES128CBCAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Cipher/AES192CBCAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Cipher/AES256CBCAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Cipher/DESCBCAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Cipher/DESEDE3CBCAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Cipher/RC2CBCAITest.php | 2 +- .../Unit/AlgoId/GenericAlgorithmIdentifierTest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA1AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA224AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA256AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA384AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA512AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/MD5AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/SHA1AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/SHA224AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/SHA256AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/SHA384AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Hash/SHA512AITest.php | 2 +- .../CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA1AITest.php | 2 +- .../Unit/AlgoId/Signature/ECDSAWithSHA224AITest.php | 2 +- .../Unit/AlgoId/Signature/ECDSAWithSHA256AITest.php | 2 +- .../Unit/AlgoId/Signature/ECDSAWithSHA384AITest.php | 2 +- .../Unit/AlgoId/Signature/ECDSAWithSHA512AITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Signature/MD2WithRSAAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Signature/MD4WithRSAAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Signature/MD5WithRSAAITest.php | 2 +- tests/CryptoTypes/Unit/AlgoId/Signature/SHA1WithRSAAITest.php | 2 +- .../CryptoTypes/Unit/AlgoId/Signature/SHA224WithRSAAITest.php | 2 +- .../CryptoTypes/Unit/AlgoId/Signature/SHA256WithRSAAITest.php | 2 +- .../CryptoTypes/Unit/AlgoId/Signature/SHA384WithRSAAITest.php | 2 +- .../CryptoTypes/Unit/AlgoId/Signature/SHA512WithRSAAITest.php | 2 +- tests/X501/Unit/ASN1/AttributeTypeTest.php | 2 +- tests/X509/Unit/Ac/V2FormTest.php | 2 +- .../Unit/Certificate/Extension/IssuerAlternativeNameTest.php | 2 +- .../Unit/Certificate/Extension/SubjectAlternativeNameTest.php | 2 +- .../Unit/Certificate/Extension/Target/TargetGroupTest.php | 2 +- .../X509/Unit/Certificate/Extension/Target/TargetNameTest.php | 2 +- .../CertificationPath/CertificationPathValidationTest.php | 2 +- 44 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/ASN1/Component/Identifier.php b/src/ASN1/Component/Identifier.php index c2f1549..dc21d79 100644 --- a/src/ASN1/Component/Identifier.php +++ b/src/ASN1/Component/Identifier.php @@ -87,7 +87,7 @@ public static function create(int $class, int $pc, BigInteger|int $tag): self * Variable is updated to the offset next to the * parsed identifier. If null, start from offset 0. */ - public static function fromDER(string $data, int &$offset = null): self + public static function fromDER(string $data, ?int &$offset = null): self { $idx = $offset ?? 0; $datalen = mb_strlen($data, '8bit'); diff --git a/src/ASN1/Component/Length.php b/src/ASN1/Component/Length.php index feb5ab3..967bf86 100644 --- a/src/ASN1/Component/Length.php +++ b/src/ASN1/Component/Length.php @@ -49,7 +49,7 @@ public static function create(BigInteger|int $length, bool $_indefinite = false) * Variable is updated to the offset next to the * parsed length component. If null, start from offset 0. */ - public static function fromDER(string $data, int &$offset = null): self + public static function fromDER(string $data, ?int &$offset = null): self { $idx = $offset ?? 0; $datalen = mb_strlen($data, '8bit'); @@ -89,7 +89,7 @@ public static function fromDER(string $data, int &$offset = null): self * @param null|int $expected Expected length, null to bypass checking * @see self::fromDER */ - public static function expectFromDER(string $data, int &$offset, int $expected = null): self + public static function expectFromDER(string $data, int &$offset, ?int $expected = null): self { $idx = $offset; $length = self::fromDER($data, $idx); diff --git a/src/ASN1/Element.php b/src/ASN1/Element.php index 3d05aaa..7ded334 100644 --- a/src/ASN1/Element.php +++ b/src/ASN1/Element.php @@ -240,7 +240,7 @@ abstract public function isConstructed(): bool; * Variable is updated to the offset next to the * parsed element. If null, start from offset 0. */ - public static function fromDER(string $data, int &$offset = null): static + public static function fromDER(string $data, ?int &$offset = null): static { $idx = $offset ?? 0; // decode identifier diff --git a/tests/CryptoTypes/Unit/AlgoId/AlgorithmIdentifierTest.php b/tests/CryptoTypes/Unit/AlgoId/AlgorithmIdentifierTest.php index 21fe9fe..9fd3b1c 100644 --- a/tests/CryptoTypes/Unit/AlgoId/AlgorithmIdentifierTest.php +++ b/tests/CryptoTypes/Unit/AlgoId/AlgorithmIdentifierTest.php @@ -51,7 +51,7 @@ public function encodeUnknown(GenericAlgorithmIdentifier $ai): void #[Test] #[Depends('fromUnknownASN1')] - public function verifyName(AlgorithmIdentifier $algo = null): void + public function verifyName(?AlgorithmIdentifier $algo = null): void { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Asymmetric/ECPKAITest.php b/tests/CryptoTypes/Unit/AlgoId/Asymmetric/ECPKAITest.php index c996022..ac3f287 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Asymmetric/ECPKAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Asymmetric/ECPKAITest.php @@ -58,7 +58,7 @@ public function namedCurve(ECPublicKeyAlgorithmIdentifier $ai) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Asymmetric/RSAEncAITest.php b/tests/CryptoTypes/Unit/AlgoId/Asymmetric/RSAEncAITest.php index b8d9cdd..ad4e551 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Asymmetric/RSAEncAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Asymmetric/RSAEncAITest.php @@ -49,7 +49,7 @@ public function decodeNoParamsFail(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Cipher/AES128CBCAITest.php b/tests/CryptoTypes/Unit/AlgoId/Cipher/AES128CBCAITest.php index 2a4b2e1..ab09c54 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Cipher/AES128CBCAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Cipher/AES128CBCAITest.php @@ -79,7 +79,7 @@ public function invalidIVSizeFail() #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Cipher/AES192CBCAITest.php b/tests/CryptoTypes/Unit/AlgoId/Cipher/AES192CBCAITest.php index 731f148..7004b2d 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Cipher/AES192CBCAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Cipher/AES192CBCAITest.php @@ -79,7 +79,7 @@ public function invalidIVSizeFail() #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Cipher/AES256CBCAITest.php b/tests/CryptoTypes/Unit/AlgoId/Cipher/AES256CBCAITest.php index b0be3c6..cb25350 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Cipher/AES256CBCAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Cipher/AES256CBCAITest.php @@ -79,7 +79,7 @@ public function invalidIVSizeFail() #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Cipher/DESCBCAITest.php b/tests/CryptoTypes/Unit/AlgoId/Cipher/DESCBCAITest.php index d781f78..3b0ab82 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Cipher/DESCBCAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Cipher/DESCBCAITest.php @@ -87,7 +87,7 @@ public function invalidIVSizeFail() #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Cipher/DESEDE3CBCAITest.php b/tests/CryptoTypes/Unit/AlgoId/Cipher/DESEDE3CBCAITest.php index 45ba432..f7a456d 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Cipher/DESEDE3CBCAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Cipher/DESEDE3CBCAITest.php @@ -79,7 +79,7 @@ public function invalidIVSizeFail() #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Cipher/RC2CBCAITest.php b/tests/CryptoTypes/Unit/AlgoId/Cipher/RC2CBCAITest.php index 42d8502..f2321c5 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Cipher/RC2CBCAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Cipher/RC2CBCAITest.php @@ -116,7 +116,7 @@ public function invalidIVSizeFail() #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/GenericAlgorithmIdentifierTest.php b/tests/CryptoTypes/Unit/AlgoId/GenericAlgorithmIdentifierTest.php index 7279ba7..699b941 100644 --- a/tests/CryptoTypes/Unit/AlgoId/GenericAlgorithmIdentifierTest.php +++ b/tests/CryptoTypes/Unit/AlgoId/GenericAlgorithmIdentifierTest.php @@ -27,7 +27,7 @@ public function create(): GenericAlgorithmIdentifier #[Test] #[Depends('create')] - public function verifyName(GenericAlgorithmIdentifier $ai = null): void + public function verifyName(?GenericAlgorithmIdentifier $ai = null): void { static::assertSame('1.3.6.1.3', $ai->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA1AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA1AITest.php index e888322..b8f3920 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA1AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA1AITest.php @@ -50,7 +50,7 @@ public function decodeWithParamsFail(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA224AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA224AITest.php index 91de6cb..9a7de8e 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA224AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA224AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA256AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA256AITest.php index c239c95..087eea2 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA256AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA256AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA384AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA384AITest.php index b0eea7b..801377d 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA384AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA384AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA512AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA512AITest.php index f18b75f..584022b 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA512AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/HMACWithSHA512AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/MD5AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/MD5AITest.php index a3da344..4e174c6 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/MD5AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/MD5AITest.php @@ -48,7 +48,7 @@ public function decodeWithoutParams(Sequence $seq) #[Test] #[Depends('decode')] - public function naverifyNameme(AlgorithmIdentifier $algo = null) + public function naverifyNameme(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA1AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA1AITest.php index 28e7570..db0804a 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA1AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA1AITest.php @@ -49,7 +49,7 @@ public function decodeWithParams(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA224AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA224AITest.php index e44ae3a..4f356e0 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA224AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA224AITest.php @@ -49,7 +49,7 @@ public function decodeWithParams(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA256AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA256AITest.php index 3a8f62f..b5f81f8 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA256AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA256AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA384AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA384AITest.php index 37256f3..7cc116c 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA384AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA384AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA512AITest.php b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA512AITest.php index ac82b06..42e1853 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Hash/SHA512AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Hash/SHA512AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA1AITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA1AITest.php index 5e4bfb6..0732764 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA1AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA1AITest.php @@ -50,7 +50,7 @@ public function decodeWithParamsFail(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA224AITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA224AITest.php index ce79260..219a8b0 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA224AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA224AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA256AITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA256AITest.php index bd04cbd..6563175 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA256AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA256AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA384AITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA384AITest.php index 32bcde2..d5597f9 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA384AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA384AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA512AITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA512AITest.php index 5193357..ed86690 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA512AITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/ECDSAWithSHA512AITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/MD2WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/MD2WithRSAAITest.php index a1cf702..0d6a298 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/MD2WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/MD2WithRSAAITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/MD4WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/MD4WithRSAAITest.php index 5589c1c..78fbc7b 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/MD4WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/MD4WithRSAAITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/MD5WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/MD5WithRSAAITest.php index ca8e2d8..22e84c6 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/MD5WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/MD5WithRSAAITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA1WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA1WithRSAAITest.php index 4abcd42..fc63358 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA1WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA1WithRSAAITest.php @@ -55,7 +55,7 @@ public function decodeInvalidParamsFail(Sequence $seq): void #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null): void + public function verifyName(?AlgorithmIdentifier $algo = null): void { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA224WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA224WithRSAAITest.php index 26d1a76..6240c20 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA224WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA224WithRSAAITest.php @@ -36,7 +36,7 @@ public function decode(Sequence $seq): AlgorithmIdentifier #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA256WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA256WithRSAAITest.php index 3a149bc..dafa9fb 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA256WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA256WithRSAAITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA384WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA384WithRSAAITest.php index 88e6001..865373e 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA384WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA384WithRSAAITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA512WithRSAAITest.php b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA512WithRSAAITest.php index 4d0e542..18bc9b8 100644 --- a/tests/CryptoTypes/Unit/AlgoId/Signature/SHA512WithRSAAITest.php +++ b/tests/CryptoTypes/Unit/AlgoId/Signature/SHA512WithRSAAITest.php @@ -39,7 +39,7 @@ public function decode(Sequence $seq) #[Test] #[Depends('decode')] - public function verifyName(AlgorithmIdentifier $algo = null) + public function verifyName(?AlgorithmIdentifier $algo = null) { static::assertIsString($algo->name()); } diff --git a/tests/X501/Unit/ASN1/AttributeTypeTest.php b/tests/X501/Unit/ASN1/AttributeTypeTest.php index c8cf2f3..5b597f8 100644 --- a/tests/X501/Unit/ASN1/AttributeTypeTest.php +++ b/tests/X501/Unit/ASN1/AttributeTypeTest.php @@ -63,7 +63,7 @@ public function oID(AttributeType $type) #[Test] #[Depends('create')] - public function verifyName(AttributeType $type = null) + public function verifyName(?AttributeType $type = null) { static::assertSame('name', $type->typeName()); } diff --git a/tests/X509/Unit/Ac/V2FormTest.php b/tests/X509/Unit/Ac/V2FormTest.php index edfafad..2dd2452 100644 --- a/tests/X509/Unit/Ac/V2FormTest.php +++ b/tests/X509/Unit/Ac/V2FormTest.php @@ -91,7 +91,7 @@ public function noIssuerNameFail() #[Test] #[Depends('create')] - public function verifyName(V2Form $issuer = null) + public function verifyName(?V2Form $issuer = null) { static::assertSame('cn=Test', $issuer->name()->toString()); } diff --git a/tests/X509/Unit/Certificate/Extension/IssuerAlternativeNameTest.php b/tests/X509/Unit/Certificate/Extension/IssuerAlternativeNameTest.php index 7cd70fb..e0441b1 100644 --- a/tests/X509/Unit/Certificate/Extension/IssuerAlternativeNameTest.php +++ b/tests/X509/Unit/Certificate/Extension/IssuerAlternativeNameTest.php @@ -77,7 +77,7 @@ public function recoded(Extension $ref, Extension $new) #[Test] #[Depends('create')] - public function verifyName(IssuerAlternativeNameExtension $ext = null) + public function verifyName(?IssuerAlternativeNameExtension $ext = null) { static::assertSame(self::DN, $ext->names()->firstDN()->toString()); } diff --git a/tests/X509/Unit/Certificate/Extension/SubjectAlternativeNameTest.php b/tests/X509/Unit/Certificate/Extension/SubjectAlternativeNameTest.php index d31c798..86e26e9 100644 --- a/tests/X509/Unit/Certificate/Extension/SubjectAlternativeNameTest.php +++ b/tests/X509/Unit/Certificate/Extension/SubjectAlternativeNameTest.php @@ -77,7 +77,7 @@ public function recoded(Extension $ref, Extension $new) #[Test] #[Depends('create')] - public function verifyName(SubjectAlternativeNameExtension $ext = null) + public function verifyName(?SubjectAlternativeNameExtension $ext = null) { static::assertSame(self::DN, $ext->names()->firstDN()->toString()); } diff --git a/tests/X509/Unit/Certificate/Extension/Target/TargetGroupTest.php b/tests/X509/Unit/Certificate/Extension/Target/TargetGroupTest.php index 973588e..2590e43 100644 --- a/tests/X509/Unit/Certificate/Extension/Target/TargetGroupTest.php +++ b/tests/X509/Unit/Certificate/Extension/Target/TargetGroupTest.php @@ -67,7 +67,7 @@ public function type(Target $target) #[Test] #[Depends('create')] - public function verifyName(TargetGroup $target = null) + public function verifyName(?TargetGroup $target = null) { $name = $target->name(); static::assertInstanceOf(GeneralName::class, $name); diff --git a/tests/X509/Unit/Certificate/Extension/Target/TargetNameTest.php b/tests/X509/Unit/Certificate/Extension/Target/TargetNameTest.php index 9a26b6c..ec1b45e 100644 --- a/tests/X509/Unit/Certificate/Extension/Target/TargetNameTest.php +++ b/tests/X509/Unit/Certificate/Extension/Target/TargetNameTest.php @@ -67,7 +67,7 @@ public function type(Target $target) #[Test] #[Depends('create')] - public function verifyName(TargetName $target = null) + public function verifyName(?TargetName $target = null) { $name = $target->name(); static::assertInstanceOf(GeneralName::class, $name); diff --git a/tests/X509/Unit/CertificationPath/CertificationPathValidationTest.php b/tests/X509/Unit/CertificationPath/CertificationPathValidationTest.php index febd190..539afe7 100644 --- a/tests/X509/Unit/CertificationPath/CertificationPathValidationTest.php +++ b/tests/X509/Unit/CertificationPath/CertificationPathValidationTest.php @@ -53,7 +53,7 @@ public function validateDefault() #[Test] #[Depends('validateDefault')] - public function verifyResult(PathValidationResult $result = null) + public function verifyResult(?PathValidationResult $result = null) { $expected_cert = Certificate::fromPEM(PEM::fromFile(TEST_ASSETS_DIR . '/certs/acme-ecdsa.pem')); static::assertEquals($expected_cert, $result->certificate()); From 5ac374c3e295c8b917208ff41b4d30f76668478c Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Fri, 3 Jan 2025 10:35:48 +0100 Subject: [PATCH 3/3] Global upgrade of the dev dependencies + PHP8.4 tests (#60) --- .github/workflows/integrate.yml | 1 + composer.json | 18 +- phpstan-baseline.neon | 648 +++++++++++++----- phpstan.neon | 2 - phpunit.xml.dist | 8 +- rector.php | 15 +- src/ASN1/Component/Length.php | 1 + src/ASN1/Element.php | 1 + src/ASN1/Type/BaseString.php | 1 + src/ASN1/Type/Primitive/GeneralizedTime.php | 18 +- src/ASN1/Type/Primitive/Number.php | 1 + src/ASN1/Type/Primitive/ObjectIdentifier.php | 1 + src/ASN1/Type/Primitive/Real.php | 39 +- src/ASN1/Type/Primitive/RelativeOID.php | 1 + src/ASN1/Type/Primitive/UTCTime.php | 16 +- src/ASN1/Type/Tagged/ImplicitlyTaggedType.php | 1 + src/ASN1/Type/UnspecifiedType.php | 1 + src/CryptoBridge/Crypto/OpenSSLCrypto.php | 1 + src/CryptoEncoding/PEM.php | 18 +- .../ECPublicKeyAlgorithmIdentifier.php | 18 +- .../RFC8410EdAlgorithmIdentifier.php | 18 +- .../RFC8410XAlgorithmIdentifier.php | 18 +- .../RSAEncryptionAlgorithmIdentifier.php | 7 +- ...RSAPSSSSAEncryptionAlgorithmIdentifier.php | 7 +- .../Cipher/AESCBCAlgorithmIdentifier.php | 8 +- .../Cipher/DESCBCAlgorithmIdentifier.php | 5 +- .../Cipher/DESEDE3CBCAlgorithmIdentifier.php | 5 +- .../Cipher/RC2CBCAlgorithmIdentifier.php | 41 +- .../Hash/HMACWithSHA1AlgorithmIdentifier.php | 7 +- .../Hash/MD5AlgorithmIdentifier.php | 19 +- .../Hash/SHA1AlgorithmIdentifier.php | 15 +- .../Hash/SHA2AlgorithmIdentifier.php | 13 +- .../ECSignatureAlgorithmIdentifier.php | 11 +- ...RFC3279RSASignatureAlgorithmIdentifier.php | 9 +- ...RFC4055RSASignatureAlgorithmIdentifier.php | 9 +- src/X501/ASN1/Attribute.php | 1 + .../Feature/DirectoryString.php | 1 + src/X501/DN/DNParser.php | 1 + src/X501/StringPrep/TranscodeStep.php | 1 + src/X509/GeneralName/IPv6Address.php | 1 + tests/ASN1/Component/LengthEncodeTest.php | 2 +- tests/ASN1/Type/Constructed/StructureTest.php | 4 +- .../Type/Primitive/Integer/EncodeTest.php | 4 +- tests/ASN1/Type/UnspecifiedTypeTest.php | 4 +- tests/ASN1/Util/FlagsTest.php | 2 +- .../Unit/Certificate/CertificateChainTest.php | 1 + .../Certificate/CertificateVersionTest.php | 10 +- 47 files changed, 653 insertions(+), 381 deletions(-) diff --git a/.github/workflows/integrate.yml b/.github/workflows/integrate.yml index a4a1ab5..5441b4e 100644 --- a/.github/workflows/integrate.yml +++ b/.github/workflows/integrate.yml @@ -57,6 +57,7 @@ jobs: - "8.1" - "8.2" - "8.3" + - "8.4" dependencies: - "lowest" - "highest" diff --git a/composer.json b/composer.json index 8621e67..34a5757 100644 --- a/composer.json +++ b/composer.json @@ -56,18 +56,16 @@ "require-dev": { "ext-gmp": "*", "ext-openssl": "*", - "ekino/phpstan-banned-code": "^1.0", - "infection/infection": "^0.28", + "ekino/phpstan-banned-code": "^1.0|^2.0|^3.0", + "infection/infection": "^0.28|^0.29", "php-parallel-lint/php-parallel-lint": "^1.3", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-beberlei-assert": "^1.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "rector/rector": "^1.0", + "phpstan/extension-installer": "^1.3|^2.0", + "phpstan/phpstan": "^1.8|^2.0", + "phpstan/phpstan-deprecation-rules": "^1.0|^2.0", + "phpstan/phpstan-phpunit": "^1.1|^2.0", + "phpstan/phpstan-strict-rules": "^1.3|^2.0", + "rector/rector": "^1.0|^2.0", "roave/security-advisories": "dev-latest", - "symfony/phpunit-bridge": "^6.4|^7.0", "symfony/string": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0", "symplify/easy-coding-standard": "^12.0", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5fd2f56..58e5588 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,891 +1,1183 @@ parameters: ignoreErrors: - - message: "#^Only numeric types are allowed in \\+, int\\|null given on the left side\\.$#" + message: '#^Only numeric types are allowed in \+, int\|null given on the left side\.$#' + identifier: plus.leftNonNumeric count: 1 path: src/ASN1/Component/Length.php - - message: "#^Only numeric types are allowed in \\-, int\\|null given on the right side\\.$#" + message: '#^Only numeric types are allowed in \-, int\|null given on the right side\.$#' + identifier: minus.rightNonNumeric count: 1 path: src/ASN1/Component/Length.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Component\\\\Length\\:\\:expectFromDER\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Component\\Length\:\:expectFromDER\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Component/Length.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\ASN1\\\\Element\\:\\:expectTagged\\(\\) should return SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\TaggedType but returns \\$this\\(SpomkyLabs\\\\Pki\\\\ASN1\\\\Element\\)\\.$#" + message: '#^Parameter \#2 \$offset of static method SpomkyLabs\\Pki\\ASN1\\Component\\Length\:\:expectFromDER\(\) expects int, int\|null given\.$#' + identifier: argument.type + count: 1 + path: src/ASN1/DERData.php + + - + message: '#^Property SpomkyLabs\\Pki\\ASN1\\DERData\:\:\$contentOffset \(int\) does not accept int\|null\.$#' + identifier: assign.propertyType + count: 1 + path: src/ASN1/DERData.php + + - + message: '#^Cannot access constant class on mixed\.$#' + identifier: classConstant.nonObject count: 1 path: src/ASN1/Element.php - - message: "#^Call to an undefined method SpomkyLabs\\\\Pki\\\\ASN1\\\\Element\\:\\:string\\(\\)\\.$#" + message: '#^Method SpomkyLabs\\Pki\\ASN1\\Element\:\:expectTagged\(\) should return SpomkyLabs\\Pki\\ASN1\\Type\\TaggedType but returns \$this\(SpomkyLabs\\Pki\\ASN1\\Element\)\.$#' + identifier: return.type count: 1 + path: src/ASN1/Element.php + + - + message: '#^Method SpomkyLabs\\Pki\\ASN1\\Element\:\:fromDER\(\) should return static\(SpomkyLabs\\Pki\\ASN1\\Element\) but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/ASN1/Element.php + + - + message: '#^Parameter \#3 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/ASN1/Element.php + + - + message: '#^Anonymous function should return string but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/ASN1/Type/Constructed/ConstructedString.php + + - + message: '#^Call to an undefined method SpomkyLabs\\Pki\\ASN1\\Element\:\:string\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/ASN1/Type/Constructed/ConstructedString.php + + - + message: '#^Parameter \#2 \.\.\.\$elements of static method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\ConstructedString\:\:createWithTag\(\) expects SpomkyLabs\\Pki\\ASN1\\Type\\StringType, SpomkyLabs\\Pki\\ASN1\\Element given\.$#' + identifier: argument.type + count: 2 path: src/ASN1/Type/Constructed/ConstructedString.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\ConstructedString\\:\\:decodeDefiniteLength\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\ConstructedString\:\:decodeDefiniteLength\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Type/Constructed/ConstructedString.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\ConstructedString\\:\\:decodeIndefiniteLength\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\ConstructedString\:\:decodeIndefiniteLength\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Type/Constructed/ConstructedString.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Sequence\\:\\:decodeDefiniteLength\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Sequence\:\:decodeDefiniteLength\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Type/Constructed/Sequence.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Sequence\\:\\:decodeIndefiniteLength\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Sequence\:\:decodeIndefiniteLength\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Type/Constructed/Sequence.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Set\\:\\:decodeFromDER\\(\\) should return SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Set but returns SpomkyLabs\\\\Pki\\\\ASN1\\\\Feature\\\\ElementBase\\.$#" + message: '#^Method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Set\:\:decodeFromDER\(\) should return SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Set but returns SpomkyLabs\\Pki\\ASN1\\Feature\\ElementBase\.$#' + identifier: return.type count: 1 path: src/ASN1/Type/Constructed/Set.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Set\\:\\:decodeDefiniteLength\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Set\:\:decodeDefiniteLength\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Type/Constructed/Set.php - - message: "#^Parameter &\\$offset by\\-ref type of method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Set\\:\\:decodeIndefiniteLength\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter &\$offset by\-ref type of method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Set\:\:decodeIndefiniteLength\(\) expects int, int\|null given\.$#' + identifier: parameterByRef.type count: 1 path: src/ASN1/Type/Constructed/Set.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\PrimitiveString\\:\\:decodeFromDER\\(\\) should return static\\(SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\PrimitiveString\\) but returns SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\PrimitiveString\\.$#" + message: '#^Method SpomkyLabs\\Pki\\ASN1\\Type\\PrimitiveString\:\:decodeFromDER\(\) should return static\(SpomkyLabs\\Pki\\ASN1\\Type\\PrimitiveString\) but returns SpomkyLabs\\Pki\\ASN1\\Type\\PrimitiveString\.$#' + identifier: return.type count: 1 path: src/ASN1/Type/PrimitiveString.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Structure implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\ASN1\\Type\\Structure implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/ASN1/Type/Structure.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Structure\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\ASN1\\Type\\Structure\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/ASN1/Type/Structure.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Structure\\:\\:getTagged\\(\\) should return SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\TaggedType but returns SpomkyLabs\\\\Pki\\\\ASN1\\\\Element\\.$#" + message: '#^Method SpomkyLabs\\Pki\\ASN1\\Type\\Structure\:\:getTagged\(\) should return SpomkyLabs\\Pki\\ASN1\\Type\\TaggedType but returns SpomkyLabs\\Pki\\ASN1\\Element\.$#' + identifier: return.type count: 1 path: src/ASN1/Type/Structure.php - - message: "#^Offset int might not exist on array\\\\|null\\.$#" + message: '#^Offset int might not exist on array\\|null\.$#' + identifier: offsetAccess.notFound count: 1 path: src/ASN1/Type/Structure.php - - message: "#^Parameter \\#2 \\$offset of static method SpomkyLabs\\\\Pki\\\\ASN1\\\\Component\\\\Length\\:\\:expectFromDER\\(\\) expects int, int\\|null given\\.$#" + message: '#^Parameter \#2 \$offset of static method SpomkyLabs\\Pki\\ASN1\\Component\\Length\:\:expectFromDER\(\) expects int, int\|null given\.$#' + identifier: argument.type count: 2 path: src/ASN1/Type/Structure.php - - message: "#^Parameter \\#2 \\$key_algo of method SpomkyLabs\\\\Pki\\\\CryptoBridge\\\\Crypto\\\\OpenSSLCrypto\\:\\:_checkSignatureAlgoAndKey\\(\\) expects SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\AlgorithmIdentifier, SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\AlgorithmIdentifierType given\\.$#" + message: '#^Parameter \#1 \$data of static method SpomkyLabs\\Pki\\CryptoTypes\\Signature\\Signature\:\:fromSignatureData\(\) expects string, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/CryptoBridge/Crypto/OpenSSLCrypto.php + + - + message: '#^Parameter \#2 \$key_algo of method SpomkyLabs\\Pki\\CryptoBridge\\Crypto\\OpenSSLCrypto\:\:_checkSignatureAlgoAndKey\(\) expects SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\AlgorithmIdentifier, SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\AlgorithmIdentifierType given\.$#' + identifier: argument.type count: 2 path: src/CryptoBridge/Crypto/OpenSSLCrypto.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\CryptoEncoding\\\\PEMBundle implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\CryptoEncoding\\PEMBundle implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/CryptoEncoding/PEMBundle.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoEncoding\\\\PEMBundle\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoEncoding\\PEMBundle\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/CryptoEncoding/PEMBundle.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Asymmetric\\\\ECPublicKeyAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\AlgorithmIdentifierFactory\:\:parse\(\) should return SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\AlgorithmIdentifier but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/CryptoTypes/AlgorithmIdentifier/AlgorithmIdentifierFactory.php + + - + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Asymmetric\\ECPublicKeyAlgorithmIdentifier\:\:paramsASN1\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Asymmetric/ECPublicKeyAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Asymmetric\\\\RSAEncryptionAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Asymmetric\\RSAEncryptionAlgorithmIdentifier\:\:paramsASN1\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Asymmetric\\\\RSAPSSSSAEncryptionAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Asymmetric\\RSAPSSSSAEncryptionAlgorithmIdentifier\:\:paramsASN1\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php - - message: "#^Parameter \\#2 \\$initializationVector of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:__construct\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#2 \$initializationVector of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:__construct\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/AES192CBCAlgorithmIdentifier.php - - message: "#^Parameter \\#2 \\$initializationVector of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:__construct\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#2 \$initializationVector of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:__construct\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/AES256CBCAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\DESCBCAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\DESCBCAlgorithmIdentifier\:\:paramsASN1\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php - - message: "#^Parameter \\#1 \\$iv of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:_checkIVSize\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$iv of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:_checkIVSize\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php - - message: "#^Parameter \\#2 \\$initializationVector of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:__construct\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#2 \$initializationVector of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:__construct\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\DESEDE3CBCAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\DESEDE3CBCAlgorithmIdentifier\:\:paramsASN1\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php - - message: "#^Parameter \\#1 \\$iv of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:_checkIVSize\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$iv of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:_checkIVSize\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php - - message: "#^Parameter \\#2 \\$initializationVector of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:__construct\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#2 \$initializationVector of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:__construct\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\RC2CBCAlgorithmIdentifier\\:\\:paramsASN1\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Cannot access offset int\ on mixed\.$#' + identifier: offsetAccess.nonOffsetAccessible count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php - - message: "#^Parameter \\#1 \\$iv of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:_checkIVSize\\(\\) expects string, string\\|null given\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\RC2CBCAlgorithmIdentifier\:\:_versionToEKB\(\) should return int but returns mixed\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php - - message: "#^Parameter \\#2 \\$initializationVector of method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Cipher\\\\CipherAlgorithmIdentifier\\:\\:__construct\\(\\) expects string, string\\|null given\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\RC2CBCAlgorithmIdentifier\:\:paramsASN1\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Hash\\\\RFC4231HMACAlgorithmIdentifier\\:\\:paramsASN1\\(\\) should return SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Primitive\\\\NullType\\|null but returns SpomkyLabs\\\\Pki\\\\ASN1\\\\Element\\|null\\.$#" + message: '#^Parameter \#1 \$iv of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:_checkIVSize\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php + + - + message: '#^Parameter \#2 \$initializationVector of method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Cipher\\CipherAlgorithmIdentifier\:\:__construct\(\) expects string, string\|null given\.$#' + identifier: argument.type + count: 1 + path: src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php + + - + message: '#^Property SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Hash\\MD5AlgorithmIdentifier\:\:\$params \(SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\NullType\|null\) is never assigned null so it can be removed from the property type\.$#' + identifier: property.unusedType + count: 1 + path: src/CryptoTypes/AlgorithmIdentifier/Hash/MD5AlgorithmIdentifier.php + + - + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Hash\\RFC4231HMACAlgorithmIdentifier\:\:paramsASN1\(\) should return SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\NullType\|null but returns SpomkyLabs\\Pki\\ASN1\\Element\|null\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/AlgorithmIdentifier/Hash/RFC4231HMACAlgorithmIdentifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\EC\\\\ECPrivateKey\\:\\:namedCurve\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\EC\\ECPrivateKey\:\:namedCurve\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/Asymmetric/EC/ECPrivateKey.php - - message: "#^Parameter \\#1 \\$ecPoint of static method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\EC\\\\ECPublicKey\\:\\:create\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$ecPoint of static method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\EC\\ECPublicKey\:\:create\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Asymmetric/EC/ECPrivateKey.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\EC\\\\ECPublicKey\\:\\:namedCurve\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\EC\\ECPublicKey\:\:namedCurve\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/Asymmetric/EC/ECPublicKey.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\:\\:attributes\\(\\) should return SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\Attribute\\\\OneAsymmetricKeyAttributes but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\Attribute\\\\OneAsymmetricKeyAttributes\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\:\:attributes\(\) should return SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\Attribute\\OneAsymmetricKeyAttributes but returns SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\Attribute\\OneAsymmetricKeyAttributes\|null\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/Asymmetric/OneAsymmetricKey.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\:\\:fromASN1\\(\\) should return static\\(SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\) but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\:\:fromASN1\(\) should return static\(SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\) but returns SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/Asymmetric/OneAsymmetricKey.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\:\\:fromPrivateKey\\(\\) should return static\\(SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\) but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\:\:fromPrivateKey\(\) should return static\(SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\) but returns SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/Asymmetric/OneAsymmetricKey.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\OneAsymmetricKey\\:\\:publicKeyData\\(\\) should return SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Primitive\\\\BitString but returns SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Primitive\\\\BitString\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\OneAsymmetricKey\:\:publicKeyData\(\) should return SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\BitString but returns SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\BitString\|null\.$#' + identifier: return.type count: 1 path: src/CryptoTypes/Asymmetric/OneAsymmetricKey.php - - message: "#^Parameter \\#2 \\$publicKey of static method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\PublicKeyInfo\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Primitive\\\\BitString, SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Primitive\\\\BitString\\|null given\\.$#" + message: '#^Parameter \#2 \$publicKey of static method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\PublicKeyInfo\:\:create\(\) expects SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\BitString, SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\BitString\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Asymmetric/OneAsymmetricKey.php - - message: "#^Parameter \\#1 \\$publicKey of static method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\RFC8410\\\\Curve25519\\\\Ed25519PublicKey\\:\\:create\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$publicKey of static method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\RFC8410\\Curve25519\\Ed25519PublicKey\:\:create\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Asymmetric/RFC8410/Curve25519/Ed25519PrivateKey.php - - message: "#^Parameter \\#1 \\$publicKey of static method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\RFC8410\\\\Curve25519\\\\X25519PublicKey\\:\\:create\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$publicKey of static method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\RFC8410\\Curve25519\\X25519PublicKey\:\:create\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Asymmetric/RFC8410/Curve25519/X25519PrivateKey.php - - message: "#^Parameter \\#1 \\$publicKey of static method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\RFC8410\\\\Curve448\\\\Ed448PublicKey\\:\\:create\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$publicKey of static method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\RFC8410\\Curve448\\Ed448PublicKey\:\:create\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Asymmetric/RFC8410/Curve448/Ed448PrivateKey.php - - message: "#^Parameter \\#1 \\$publicKey of static method SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\RFC8410\\\\Curve448\\\\X448PublicKey\\:\\:create\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$publicKey of static method SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\RFC8410\\Curve448\\X448PublicKey\:\:create\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Asymmetric/RFC8410/Curve448/X448PrivateKey.php - - message: "#^Parameter \\#1 \\$string of static method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Primitive\\\\BitString\\:\\:create\\(\\) expects string, string\\|null given\\.$#" + message: '#^Parameter \#1 \$idx of method SpomkyLabs\\Pki\\ASN1\\Type\\Structure\:\:at\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/CryptoTypes/Asymmetric/RSA/RSAPrivateKey.php + + - + message: '#^Parameter \#1 \$idx of method SpomkyLabs\\Pki\\ASN1\\Type\\Structure\:\:at\(\) expects int, mixed given\.$#' + identifier: argument.type + count: 1 + path: src/CryptoTypes/Asymmetric/RSA/RSASSAPSSPrivateKey.php + + - + message: '#^Parameter \#1 \$string of static method SpomkyLabs\\Pki\\ASN1\\Type\\Primitive\\BitString\:\:create\(\) expects string, string\|null given\.$#' + identifier: argument.type count: 1 path: src/CryptoTypes/Signature/RSASignature.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Attribute implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X501\\ASN1\\Attribute implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/Attribute.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Attribute\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\ASN1\\Attribute\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/Attribute.php - - message: "#^PHPDoc tag @var with type SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue is not subtype of native type class\\-string\\\\.$#" + message: '#^PHPDoc tag @var with type SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue is not subtype of native type class\-string\\.$#' + identifier: varTag.nativeType count: 1 path: src/X501/ASN1/Attribute.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Collection\\\\AttributeCollection implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\ASN1\\AttributeType\:\:_oidReverseMap\(\) should return array\ but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/X501/ASN1/AttributeType.php + + - + message: '#^Method SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\Feature\\DirectoryString\:\:toASN1\(\) should return SpomkyLabs\\Pki\\ASN1\\Element but returns mixed\.$#' + identifier: return.type + count: 1 + path: src/X501/ASN1/AttributeValue/Feature/DirectoryString.php + + - + message: '#^Class SpomkyLabs\\Pki\\X501\\ASN1\\Collection\\AttributeCollection implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/Collection/AttributeCollection.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Collection\\\\AttributeCollection\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\ASN1\\Collection\\AttributeCollection\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/Collection/AttributeCollection.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Name implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X501\\ASN1\\Name implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/Name.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Name\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\ASN1\\Name\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/Name.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\RDN implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X501\\ASN1\\RDN implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/RDN.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\RDN\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\ASN1\\RDN\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X501/ASN1/RDN.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\DN\\\\DNParser\\:\\:_parseAttrHexValue\\(\\) should return string but returns string\\|false\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\DN\\DNParser\:\:_parseAttrHexValue\(\) should return string but returns string\|false\.$#' + identifier: return.type count: 1 path: src/X501/DN/DNParser.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\DN\\\\DNParser\\:\\:_parseAttrTypeAndValue\\(\\) should return array\\ but returns array\\\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\DN\\DNParser\:\:_parseAttrTypeAndValue\(\) should return array\ but returns array\\.$#' + identifier: return.type count: 1 path: src/X501/DN/DNParser.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\DN\\\\DNParser\\:\\:_parseName\\(\\) should return array\\\\> but returns array\\\\>\\>\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\DN\\DNParser\:\:_parseName\(\) should return array\\> but returns list\\>\>\.$#' + identifier: return.type count: 1 path: src/X501/DN/DNParser.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\DN\\\\DNParser\\:\\:_regexMatch\\(\\) should return string\\|null but returns string\\|false\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\DN\\DNParser\:\:_regexMatch\(\) should return string\|null but returns string\|false\.$#' + identifier: return.type count: 1 path: src/X501/DN/DNParser.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\DN\\\\DNParser\\:\\:escapeString\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\DN\\DNParser\:\:escapeString\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X501/DN/DNParser.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\MatchingRule\\\\BinaryMatch\\:\\:compare\\(\\) never returns null so it can be removed from the return type\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\MatchingRule\\BinaryMatch\:\:compare\(\) never returns null so it can be removed from the return type\.$#' + identifier: return.unusedType count: 1 path: src/X501/MatchingRule/BinaryMatch.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X501\\\\StringPrep\\\\NormalizeStep\\:\\:apply\\(\\) should return string but returns string\\|false\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X501\\StringPrep\\NormalizeStep\:\:apply\(\) should return string but returns string\|false\.$#' + identifier: return.type count: 1 path: src/X501/StringPrep/NormalizeStep.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\AttCertValidityPeriod\\:\\:roundDownFractionalSeconds\\(\\) should return DateTimeImmutable but returns DateTimeImmutable\\|false\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\AttCertValidityPeriod\:\:roundDownFractionalSeconds\(\) should return DateTimeImmutable but returns DateTimeImmutable\|false\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/AttCertValidityPeriod.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\IetfAttrSyntax implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\IetfAttrSyntax implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/AttributeCertificate/Attribute/IetfAttrSyntax.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\IetfAttrSyntax\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\IetfAttrSyntax\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/AttributeCertificate/Attribute/IetfAttrSyntax.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\IetfAttrSyntax\\:\\:policyAuthority\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames but returns SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\IetfAttrSyntax\:\:policyAuthority\(\) should return SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames but returns SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attribute/IetfAttrSyntax.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\RoleAttributeValue\\:\\:roleAuthority\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames but returns SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\RoleAttributeValue\:\:roleAuthority\(\) should return SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames but returns SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attribute/RoleAttributeValue.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\SvceAuthInfo\\:\\:authInfo\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\SvceAuthInfo\:\:authInfo\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attribute/SvceAuthInfo.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\AttributeCertificateInfo\\:\\:issuerUniqueID\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\AttributeCertificateInfo\:\:issuerUniqueID\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier but returns SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/AttributeCertificateInfo.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\AttributeCertificateInfo\\:\\:serialNumber\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\AttributeCertificateInfo\:\:serialNumber\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/AttributeCertificateInfo.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\AttributeCertificateInfo\\:\\:signature\\(\\) should return SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\SignatureAlgorithmIdentifier but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\SignatureAlgorithmIdentifier\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\AttributeCertificateInfo\:\:signature\(\) should return SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\SignatureAlgorithmIdentifier but returns SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\SignatureAlgorithmIdentifier\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/AttributeCertificateInfo.php - - message: "#^Parameter \\#4 \\$attributes of static method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\AttributeCertificateInfo\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes, SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Collection\\\\SequenceOfAttributes given\\.$#" + message: '#^Parameter \#4 \$attributes of static method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\AttributeCertificateInfo\:\:create\(\) expects SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes, SpomkyLabs\\Pki\\X501\\ASN1\\Collection\\SequenceOfAttributes given\.$#' + identifier: argument.type count: 1 path: src/X509/AttributeCertificate/AttributeCertificateInfo.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes\\:\\:accessIdentity\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\AccessIdentityAttributeValue but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes\:\:accessIdentity\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\AccessIdentityAttributeValue but returns SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes\\:\\:authenticationInformation\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\AuthenticationInfoAttributeValue but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes\:\:authenticationInformation\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\AuthenticationInfoAttributeValue but returns SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes\\:\\:chargingIdentity\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\ChargingIdentityAttributeValue but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes\:\:chargingIdentity\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\ChargingIdentityAttributeValue but returns SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes\\:\\:group\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\GroupAttributeValue but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes\:\:group\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\GroupAttributeValue but returns SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes\\:\\:role\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attribute\\\\RoleAttributeValue but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes\:\:role\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attribute\\RoleAttributeValue but returns SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Attributes\\:\\:roles\\(\\) should return array\\ but returns array\\\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Attributes\:\:roles\(\) should return array\ but returns array\\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Holder\\:\\:baseCertificateID\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\IssuerSerial but returns SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\IssuerSerial\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Holder\:\:baseCertificateID\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\IssuerSerial but returns SpomkyLabs\\Pki\\X509\\AttributeCertificate\\IssuerSerial\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Holder.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Holder\\:\\:entityName\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames but returns SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Holder\:\:entityName\(\) should return SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames but returns SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Holder.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\Holder\\:\\:objectDigestInfo\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\ObjectDigestInfo but returns SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\ObjectDigestInfo\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\Holder\:\:objectDigestInfo\(\) should return SpomkyLabs\\Pki\\X509\\AttributeCertificate\\ObjectDigestInfo but returns SpomkyLabs\\Pki\\X509\\AttributeCertificate\\ObjectDigestInfo\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/Holder.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\IssuerSerial\\:\\:issuerUID\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\IssuerSerial\:\:issuerUID\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier but returns SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/IssuerSerial.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\AttributeCertificate\\\\V2Form\\:\\:issuerName\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames but returns SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\AttributeCertificate\\V2Form\:\:issuerName\(\) should return SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames but returns SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\|null\.$#' + identifier: return.type count: 1 path: src/X509/AttributeCertificate/V2Form.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\CertificateBundle implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\CertificateBundle implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/CertificateBundle.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\CertificateBundle\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\CertificateBundle\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/CertificateBundle.php - - message: "#^Parameter \\#1 \\$pem of static method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Certificate\\:\\:fromPEM\\(\\) expects SpomkyLabs\\\\Pki\\\\CryptoEncoding\\\\PEM, mixed given\\.$#" + message: '#^Parameter \#1 \$pem of static method SpomkyLabs\\Pki\\X509\\Certificate\\Certificate\:\:fromPEM\(\) expects SpomkyLabs\\Pki\\CryptoEncoding\\PEM, mixed given\.$#' + identifier: argument.type count: 1 path: src/X509/Certificate/CertificateBundle.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\CertificateChain implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\CertificateChain implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/CertificateChain.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\CertificateChain\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\CertificateChain\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/CertificateChain.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AAControlsExtension\\:\\:excludedAttrs\\(\\) should return array\\ but returns array\\\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AAControlsExtension\:\:excludedAttrs\(\) should return array\ but returns array\\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/AAControlsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AAControlsExtension\\:\\:pathLen\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AAControlsExtension\:\:pathLen\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/AAControlsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AAControlsExtension\\:\\:permittedAttrs\\(\\) should return array\\ but returns array\\\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AAControlsExtension\:\:permittedAttrs\(\) should return array\ but returns array\\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/AAControlsExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AuthorityInformationAccessExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AuthorityInformationAccessExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/AuthorityInformationAccessExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AuthorityInformationAccessExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AuthorityInformationAccessExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/AuthorityInformationAccessExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AuthorityKeyIdentifierExtension\\:\\:issuer\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames but returns SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AuthorityKeyIdentifierExtension\:\:issuer\(\) should return SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames but returns SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/AuthorityKeyIdentifierExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AuthorityKeyIdentifierExtension\\:\\:keyIdentifier\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AuthorityKeyIdentifierExtension\:\:keyIdentifier\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/AuthorityKeyIdentifierExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AuthorityKeyIdentifierExtension\\:\\:serial\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AuthorityKeyIdentifierExtension\:\:serial\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/AuthorityKeyIdentifierExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\BasicConstraintsExtension\\:\\:pathLen\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\BasicConstraintsExtension\:\:pathLen\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/BasicConstraintsExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CRLDistributionPointsExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CRLDistributionPointsExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/CRLDistributionPointsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CRLDistributionPointsExtension\\:\\:fromDER\\(\\) should return static\\(SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CRLDistributionPointsExtension\\) but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CRLDistributionPointsExtension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CRLDistributionPointsExtension\:\:fromDER\(\) should return static\(SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CRLDistributionPointsExtension\) but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CRLDistributionPointsExtension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/CRLDistributionPointsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CRLDistributionPointsExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CRLDistributionPointsExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/CRLDistributionPointsExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePoliciesExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePoliciesExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/CertificatePoliciesExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePoliciesExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePoliciesExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/CertificatePoliciesExtension.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$elements of static method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Sequence\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\ASN1\\\\Element, SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\StringType given\\.$#" + message: '#^Parameter \#1 \.\.\.\$elements of static method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Sequence\:\:create\(\) expects SpomkyLabs\\Pki\\ASN1\\Element, SpomkyLabs\\Pki\\ASN1\\Type\\StringType given\.$#' + identifier: argument.type count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/NoticeReference.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\PolicyInformation implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\PolicyInformation implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\PolicyInformation\\:\\:CPSQualifier\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\CPSQualifier but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\PolicyQualifierInfo\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\PolicyInformation\:\:CPSQualifier\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\CPSQualifier but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\PolicyQualifierInfo\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\PolicyInformation\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\PolicyInformation\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\PolicyInformation\\:\\:userNoticeQualifier\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\UserNoticeQualifier but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\PolicyQualifierInfo\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\PolicyInformation\:\:userNoticeQualifier\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\UserNoticeQualifier but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\PolicyQualifierInfo\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/PolicyInformation.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\UserNoticeQualifier\\:\\:explicitText\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\DisplayText but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\DisplayText\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\UserNoticeQualifier\:\:explicitText\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\DisplayText but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\DisplayText\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/UserNoticeQualifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\UserNoticeQualifier\\:\\:noticeRef\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\NoticeReference but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePolicy\\\\NoticeReference\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\UserNoticeQualifier\:\:noticeRef\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\NoticeReference but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePolicy\\NoticeReference\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/CertificatePolicy/UserNoticeQualifier.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\DistributionPoint\\:\\:crlIssuer\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames but returns SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\DistributionPoint\:\:crlIssuer\(\) should return SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames but returns SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/DistributionPoint/DistributionPoint.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\DistributionPoint\\:\\:distributionPointName\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\DistributionPointName but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\DistributionPointName\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\DistributionPoint\:\:distributionPointName\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\DistributionPointName but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\DistributionPointName\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/DistributionPoint/DistributionPoint.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\DistributionPoint\\:\\:reasons\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\ReasonFlags but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\DistributionPoint\\\\ReasonFlags\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\DistributionPoint\:\:reasons\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\ReasonFlags but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\DistributionPoint\\ReasonFlags\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/DistributionPoint/DistributionPoint.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\ExtendedKeyUsageExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\ExtendedKeyUsageExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/ExtendedKeyUsageExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\ExtendedKeyUsageExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\ExtendedKeyUsageExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/ExtendedKeyUsageExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraints\\\\GeneralSubtrees implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraints\\GeneralSubtrees implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/NameConstraints/GeneralSubtrees.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraints\\\\GeneralSubtrees\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraints\\GeneralSubtrees\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/NameConstraints/GeneralSubtrees.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraintsExtension\\:\\:excludedSubtrees\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraints\\\\GeneralSubtrees but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraints\\\\GeneralSubtrees\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraintsExtension\:\:excludedSubtrees\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraints\\GeneralSubtrees but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraints\\GeneralSubtrees\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/NameConstraintsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraintsExtension\\:\\:permittedSubtrees\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraints\\\\GeneralSubtrees but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraints\\\\GeneralSubtrees\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraintsExtension\:\:permittedSubtrees\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraints\\GeneralSubtrees but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraints\\GeneralSubtrees\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/NameConstraintsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\PolicyConstraintsExtension\\:\\:inhibitPolicyMapping\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\PolicyConstraintsExtension\:\:inhibitPolicyMapping\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/PolicyConstraintsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\PolicyConstraintsExtension\\:\\:requireExplicitPolicy\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\PolicyConstraintsExtension\:\:requireExplicitPolicy\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extension/PolicyConstraintsExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\PolicyMappingsExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\PolicyMappingsExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/PolicyMappingsExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\PolicyMappingsExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\PolicyMappingsExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/PolicyMappingsExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\SubjectDirectoryAttributesExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\SubjectDirectoryAttributesExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/SubjectDirectoryAttributesExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\SubjectDirectoryAttributesExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\SubjectDirectoryAttributesExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/SubjectDirectoryAttributesExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\SubjectInformationAccessExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\SubjectInformationAccessExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/SubjectInformationAccessExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\SubjectInformationAccessExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\SubjectInformationAccessExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/SubjectInformationAccessExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Target\\\\Targets implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Target\\Targets implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/Target/Targets.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Target\\\\Targets\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Target\\Targets\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/Target/Targets.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\TargetInformationExtension implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\TargetInformationExtension implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/TargetInformationExtension.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\TargetInformationExtension\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\TargetInformationExtension\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extension/TargetInformationExtension.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\Certificate\\Extensions implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:authorityKeyIdentifier\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\AuthorityKeyIdentifierExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:authorityKeyIdentifier\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\AuthorityKeyIdentifierExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:basicConstraints\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\BasicConstraintsExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:basicConstraints\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\BasicConstraintsExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:certificatePolicies\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CertificatePoliciesExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:certificatePolicies\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CertificatePoliciesExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:crlDistributionPoints\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\CRLDistributionPointsExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:crlDistributionPoints\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\CRLDistributionPointsExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:extendedKeyUsage\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\ExtendedKeyUsageExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:extendedKeyUsage\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\ExtendedKeyUsageExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:inhibitAnyPolicy\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\InhibitAnyPolicyExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:inhibitAnyPolicy\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\InhibitAnyPolicyExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:issuerAlternativeName\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\IssuerAlternativeNameExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:issuerAlternativeName\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\IssuerAlternativeNameExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:keyUsage\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\KeyUsageExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:keyUsage\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\KeyUsageExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:nameConstraints\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\NameConstraintsExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:nameConstraints\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\NameConstraintsExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:policyConstraints\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\PolicyConstraintsExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:policyConstraints\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\PolicyConstraintsExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:policyMappings\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\PolicyMappingsExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:policyMappings\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\PolicyMappingsExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:subjectAlternativeName\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\SubjectAlternativeNameExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:subjectAlternativeName\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\SubjectAlternativeNameExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extensions\\:\\:subjectKeyIdentifier\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\SubjectKeyIdentifierExtension but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Extension\\\\Extension\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Extensions\:\:subjectKeyIdentifier\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\SubjectKeyIdentifierExtension but returns SpomkyLabs\\Pki\\X509\\Certificate\\Extension\\Extension\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Extensions.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\TBSCertificate\\:\\:issuerUniqueID\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\TBSCertificate\:\:issuerUniqueID\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier but returns SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/TBSCertificate.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\TBSCertificate\\:\\:serialNumber\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\TBSCertificate\:\:serialNumber\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/TBSCertificate.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\TBSCertificate\\:\\:signature\\(\\) should return SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\SignatureAlgorithmIdentifier but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\SignatureAlgorithmIdentifier\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\TBSCertificate\:\:signature\(\) should return SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\SignatureAlgorithmIdentifier but returns SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\SignatureAlgorithmIdentifier\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/TBSCertificate.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\TBSCertificate\\:\\:subjectUniqueID\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\UniqueIdentifier\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\TBSCertificate\:\:subjectUniqueID\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier but returns SpomkyLabs\\Pki\\X509\\Certificate\\UniqueIdentifier\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/TBSCertificate.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\TBSCertificate\\:\\:version\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\TBSCertificate\:\:version\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/TBSCertificate.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Time\\:\\:roundDownFractionalSeconds\\(\\) should return DateTimeImmutable but returns DateTimeImmutable\\|false\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\Certificate\\Time\:\:roundDownFractionalSeconds\(\) should return DateTimeImmutable but returns DateTimeImmutable\|false\.$#' + identifier: return.type count: 1 path: src/X509/Certificate/Time.php - - message: "#^Parameter \\#1 \\.\\.\\.\\$elements of static method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Sequence\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\ASN1\\\\Element, SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\TimeType given\\.$#" + message: '#^Parameter \#1 \.\.\.\$elements of static method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Sequence\:\:create\(\) expects SpomkyLabs\\Pki\\ASN1\\Element, SpomkyLabs\\Pki\\ASN1\\Type\\TimeType given\.$#' + identifier: argument.type count: 1 path: src/X509/Certificate/Validity.php - - message: "#^Parameter \\#2 \\.\\.\\.\\$elements of static method SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\Constructed\\\\Sequence\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\ASN1\\\\Element, SpomkyLabs\\\\Pki\\\\ASN1\\\\Type\\\\TimeType given\\.$#" + message: '#^Parameter \#2 \.\.\.\$elements of static method SpomkyLabs\\Pki\\ASN1\\Type\\Constructed\\Sequence\:\:create\(\) expects SpomkyLabs\\Pki\\ASN1\\Element, SpomkyLabs\\Pki\\ASN1\\Type\\TimeType given\.$#' + identifier: argument.type count: 1 path: src/X509/Certificate/Validity.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\CertificationPath implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\CertificationPath\\CertificationPath implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/CertificationPath/CertificationPath.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\CertificationPath\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\CertificationPath\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/CertificationPath/CertificationPath.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\PathValidationConfig\\:\\:trustAnchor\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Certificate but returns SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Certificate\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\PathValidationConfig\:\:trustAnchor\(\) should return SpomkyLabs\\Pki\\X509\\Certificate\\Certificate but returns SpomkyLabs\\Pki\\X509\\Certificate\\Certificate\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/PathValidationConfig.php - - message: "#^Parameter \\#2 \\$trust_anchor of static method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:initialize\\(\\) expects SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Certificate, SpomkyLabs\\\\Pki\\\\X509\\\\Certificate\\\\Certificate\\|null given\\.$#" + message: '#^Call to method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:excludedSubtrees\(\) on a separate line has no effect\.$#' + identifier: method.resultUnused + count: 1 + path: src/X509/CertificationPath/PathValidation/PathValidator.php + + - + message: '#^Call to method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:permittedSubtrees\(\) on a separate line has no effect\.$#' + identifier: method.resultUnused + count: 1 + path: src/X509/CertificationPath/PathValidation/PathValidator.php + + - + message: '#^Parameter \#2 \$trust_anchor of static method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:initialize\(\) expects SpomkyLabs\\Pki\\X509\\Certificate\\Certificate, SpomkyLabs\\Pki\\X509\\Certificate\\Certificate\|null given\.$#' + identifier: argument.type count: 1 path: src/X509/CertificationPath/PathValidation/PathValidator.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:explicitPolicy\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:explicitPolicy\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:index\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:index\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:inhibitAnyPolicy\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:inhibitAnyPolicy\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:maxPathLength\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:maxPathLength\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:pathLength\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:pathLength\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:policyMapping\\(\\) should return int but returns int\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:policyMapping\(\) should return int but returns int\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:validPolicyTree\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\Policy\\\\PolicyTree but returns SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\Policy\\\\PolicyTree\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:validPolicyTree\(\) should return SpomkyLabs\\Pki\\X509\\CertificationPath\\Policy\\PolicyTree but returns SpomkyLabs\\Pki\\X509\\CertificationPath\\Policy\\PolicyTree\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:workingIssuerName\\(\\) should return SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Name but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\Name\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:workingIssuerName\(\) should return SpomkyLabs\\Pki\\X501\\ASN1\\Name but returns SpomkyLabs\\Pki\\X501\\ASN1\\Name\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:workingPublicKey\\(\\) should return SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\PublicKeyInfo but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\PublicKeyInfo\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:workingPublicKey\(\) should return SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\PublicKeyInfo but returns SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\PublicKeyInfo\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\ValidatorState\\:\\:workingPublicKeyAlgorithm\\(\\) should return SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\AlgorithmIdentifierType but returns SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\AlgorithmIdentifierType\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\ValidatorState\:\:workingPublicKeyAlgorithm\(\) should return SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\AlgorithmIdentifierType but returns SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\AlgorithmIdentifierType\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Parameter \\#3 \\$publicKeyInfo of static method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\PathValidationResult\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\PublicKeyInfo, SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\Asymmetric\\\\PublicKeyInfo\\|null given\\.$#" + message: '#^Parameter \#3 \$publicKeyInfo of static method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\PathValidationResult\:\:create\(\) expects SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\PublicKeyInfo, SpomkyLabs\\Pki\\CryptoTypes\\Asymmetric\\PublicKeyInfo\|null given\.$#' + identifier: argument.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Parameter \\#4 \\$publicKeyAlgo of static method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\PathValidation\\\\PathValidationResult\\:\\:create\\(\\) expects SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\AlgorithmIdentifierType, SpomkyLabs\\\\Pki\\\\CryptoTypes\\\\AlgorithmIdentifier\\\\Feature\\\\AlgorithmIdentifierType\\|null given\\.$#" + message: '#^Parameter \#4 \$publicKeyAlgo of static method SpomkyLabs\\Pki\\X509\\CertificationPath\\PathValidation\\PathValidationResult\:\:create\(\) expects SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\AlgorithmIdentifierType, SpomkyLabs\\Pki\\CryptoTypes\\AlgorithmIdentifier\\Feature\\AlgorithmIdentifierType\|null given\.$#' + identifier: argument.type count: 1 path: src/X509/CertificationPath/PathValidation/ValidatorState.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\Policy\\\\PolicyNode implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\CertificationPath\\Policy\\PolicyNode implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/CertificationPath/Policy/PolicyNode.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationPath\\\\Policy\\\\PolicyNode\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationPath\\Policy\\PolicyNode\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/CertificationPath/Policy/PolicyNode.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationRequest\\\\Attributes\\:\\:extensionRequest\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\CertificationRequest\\\\Attribute\\\\ExtensionRequestValue but returns SpomkyLabs\\\\Pki\\\\X501\\\\ASN1\\\\AttributeValue\\\\AttributeValue\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationRequest\\Attributes\:\:extensionRequest\(\) should return SpomkyLabs\\Pki\\X509\\CertificationRequest\\Attribute\\ExtensionRequestValue but returns SpomkyLabs\\Pki\\X501\\ASN1\\AttributeValue\\AttributeValue\.$#' + identifier: return.type count: 1 path: src/X509/CertificationRequest/Attributes.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\CertificationRequest\\\\CertificationRequestInfo\\:\\:attributes\\(\\) should return SpomkyLabs\\\\Pki\\\\X509\\\\CertificationRequest\\\\Attributes but returns SpomkyLabs\\\\Pki\\\\X509\\\\CertificationRequest\\\\Attributes\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\CertificationRequest\\CertificationRequestInfo\:\:attributes\(\) should return SpomkyLabs\\Pki\\X509\\CertificationRequest\\Attributes but returns SpomkyLabs\\Pki\\X509\\CertificationRequest\\Attributes\|null\.$#' + identifier: return.type count: 1 path: src/X509/CertificationRequest/CertificationRequestInfo.php - - message: "#^Class SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" + message: '#^Class SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames implements generic interface IteratorAggregate but does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/GeneralName/GeneralNames.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\GeneralNames\\:\\:getIterator\\(\\) return type with generic class ArrayIterator does not specify its types\\: TKey, TValue$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\GeneralName\\GeneralNames\:\:getIterator\(\) return type with generic class ArrayIterator does not specify its types\: TKey, TValue$#' + identifier: missingType.generics count: 1 path: src/X509/GeneralName/GeneralNames.php - - message: "#^Method SpomkyLabs\\\\Pki\\\\X509\\\\GeneralName\\\\IPAddress\\:\\:mask\\(\\) should return string but returns string\\|null\\.$#" + message: '#^Method SpomkyLabs\\Pki\\X509\\GeneralName\\IPAddress\:\:mask\(\) should return string but returns string\|null\.$#' + identifier: return.type count: 1 path: src/X509/GeneralName/IPAddress.php + + - + message: '#^Parameter \#1 \$words of static method SpomkyLabs\\Pki\\X509\\GeneralName\\IPv6Address\:\:wordsToIPv6String\(\) expects array\, array given\.$#' + identifier: argument.type + count: 3 + path: src/X509/GeneralName/IPv6Address.php diff --git a/phpstan.neon b/phpstan.neon index fc6c908..404e222 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,8 +2,6 @@ parameters: level: max paths: - src - checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: true checkUninitializedProperties: true treatPhpDocTypesAsCertain: false includes: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 94dbce3..8c23169 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -35,13 +35,9 @@ - - - + + - - - diff --git a/rector.php b/rector.php index 47dcae8..90dad50 100644 --- a/rector.php +++ b/rector.php @@ -6,28 +6,23 @@ use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\DataProviderArrayItemsNewLinedRector; use Rector\PHPUnit\Set\PHPUnitSetList; -use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\Symfony\Set\SymfonySetList; -use Rector\Symfony\Symfony42\Rector\New_\StringToArrayArgumentProcessRector; use Rector\ValueObject\PhpVersion; return static function (RectorConfig $config): void { $config->import(SetList::DEAD_CODE); - $config->import(LevelSetList::UP_TO_PHP_81); + $config->import(SetList::PHP_81); $config->import(SymfonySetList::SYMFONY_50_TYPES); - $config->import(SymfonySetList::SYMFONY_52_VALIDATOR_ATTRIBUTES); $config->import(SymfonySetList::SYMFONY_CODE_QUALITY); $config->import(SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION); - $config->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES); $config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY); $config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES); $config->paths([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php', __DIR__ . '/rector.php']); - $config->skip([ - DataProviderArrayItemsNewLinedRector::class, - PreferPHPUnitThisCallRector::class, - StringToArrayArgumentProcessRector::class => [__DIR__ . '/tests'], - ]); + $config->skip([DataProviderArrayItemsNewLinedRector::class, PreferPHPUnitThisCallRector::class]); + $config::configure()->withComposerBased(twig: true, phpunit: true); + $config::configure()->withPhpSets(); + $config::configure()->withAttributesSets(); $config->phpVersion(PhpVersion::PHP_81); $config->parallel(); $config->importNames(); diff --git a/src/ASN1/Component/Length.php b/src/ASN1/Component/Length.php index 967bf86..e69e92d 100644 --- a/src/ASN1/Component/Length.php +++ b/src/ASN1/Component/Length.php @@ -13,6 +13,7 @@ use function count; use function mb_strlen; use function ord; +use function sprintf; /** * Class to represent BER/DER length octets. diff --git a/src/ASN1/Element.php b/src/ASN1/Element.php index 7ded334..fa7795c 100644 --- a/src/ASN1/Element.php +++ b/src/ASN1/Element.php @@ -46,6 +46,7 @@ use UnexpectedValueException; use function array_key_exists; use function mb_strlen; +use function sprintf; /** * Base class for all ASN.1 type elements. diff --git a/src/ASN1/Type/BaseString.php b/src/ASN1/Type/BaseString.php index 34cae98..b777e8a 100644 --- a/src/ASN1/Type/BaseString.php +++ b/src/ASN1/Type/BaseString.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use SpomkyLabs\Pki\ASN1\Element; use Stringable; +use function sprintf; /** * Base class for all string types. diff --git a/src/ASN1/Type/Primitive/GeneralizedTime.php b/src/ASN1/Type/Primitive/GeneralizedTime.php index 62de771..07adb81 100644 --- a/src/ASN1/Type/Primitive/GeneralizedTime.php +++ b/src/ASN1/Type/Primitive/GeneralizedTime.php @@ -34,15 +34,15 @@ final class GeneralizedTime extends BaseTime * @var string */ final public const REGEX = '#^' . - '(\d\d\d\d)' . // YYYY - '(\d\d)' . // MM - '(\d\d)' . // DD - '(\d\d)' . // hh - '(\d\d)' . // mm - '(\d\d)' . // ss - '(?:\.(\d+))?' . // frac - 'Z' . // TZ - '$#'; + '(\d\d\d\d)' . // YYYY + '(\d\d)' . // MM + '(\d\d)' . // DD + '(\d\d)' . // hh + '(\d\d)' . // mm + '(\d\d)' . // ss + '(?:\.(\d+))?' . // frac + 'Z' . // TZ + '$#'; /** * Cached formatted date. diff --git a/src/ASN1/Type/Primitive/Number.php b/src/ASN1/Type/Primitive/Number.php index bbf5ed2..8fe2afc 100644 --- a/src/ASN1/Type/Primitive/Number.php +++ b/src/ASN1/Type/Primitive/Number.php @@ -14,6 +14,7 @@ use function is_int; use function is_scalar; use function is_string; +use function sprintf; use function strval; abstract class Number extends Element diff --git a/src/ASN1/Type/Primitive/ObjectIdentifier.php b/src/ASN1/Type/Primitive/ObjectIdentifier.php index 207842a..3a4c003 100644 --- a/src/ASN1/Type/Primitive/ObjectIdentifier.php +++ b/src/ASN1/Type/Primitive/ObjectIdentifier.php @@ -20,6 +20,7 @@ use function is_int; use function mb_strlen; use function ord; +use function sprintf; /** * Implements *OBJECT IDENTIFIER* type. diff --git a/src/ASN1/Type/Primitive/Real.php b/src/ASN1/Type/Primitive/Real.php index 725692a..cbc7c43 100644 --- a/src/ASN1/Type/Primitive/Real.php +++ b/src/ASN1/Type/Primitive/Real.php @@ -22,6 +22,7 @@ use function in_array; use function mb_strlen; use function ord; +use function sprintf; use const INF; /** @@ -38,9 +39,9 @@ final class Real extends Element implements Stringable * @var string */ final public const NR1_REGEX = '/^\s*' . - '(?[+\-])?' . // sign - '(?\d+)' . // integer - '$/'; + '(?[+\-])?' . // sign + '(?\d+)' . // integer + '$/'; /** * Regex pattern to parse NR2 form number. @@ -48,9 +49,9 @@ final class Real extends Element implements Stringable * @var string */ final public const NR2_REGEX = '/^\s*' . - '(?[+\-])?' . // sign - '(?(?:\d+[\.,]\d*)|(?:\d*[\.,]\d+))' . // decimal number - '$/'; + '(?[+\-])?' . // sign + '(?(?:\d+[\.,]\d*)|(?:\d*[\.,]\d+))' . // decimal number + '$/'; /** * Regex pattern to parse NR3 form number. @@ -58,11 +59,11 @@ final class Real extends Element implements Stringable * @var string */ final public const NR3_REGEX = '/^\s*' . - '(?[+\-])?' . // mantissa sign - '(?(?:\d+[\.,]\d*)|(?:\d*[\.,]\d+))' . // mantissa - '[Ee](?[+\-])?' . // exponent sign - '(?\d+)' . // exponent - '$/'; + '(?[+\-])?' . // mantissa sign + '(?(?:\d+[\.,]\d*)|(?:\d*[\.,]\d+))' . // mantissa + '[Ee](?[+\-])?' . // exponent sign + '(?\d+)' . // exponent + '$/'; /** * Regex pattern to parse PHP exponent number format. @@ -72,14 +73,14 @@ final class Real extends Element implements Stringable * @var string */ final public const PHP_EXPONENT_DNUM = '/^' . - '(?[+\-])?' . // sign - '(?' . - '\d+' . // LNUM - '|' . - '(?:\d*\.\d+|\d+\.\d*)' . // DNUM - ')[eE]' . - '(?[+\-])?(?\d+)' . // exponent - '$/'; + '(?[+\-])?' . // sign + '(?' . + '\d+' . // LNUM + '|' . + '(?:\d*\.\d+|\d+\.\d*)' . // DNUM + ')[eE]' . + '(?[+\-])?(?\d+)' . // exponent + '$/'; /** * Exponent when value is positive or negative infinite. diff --git a/src/ASN1/Type/Primitive/RelativeOID.php b/src/ASN1/Type/Primitive/RelativeOID.php index f09ac6b..5f30881 100644 --- a/src/ASN1/Type/Primitive/RelativeOID.php +++ b/src/ASN1/Type/Primitive/RelativeOID.php @@ -18,6 +18,7 @@ use function chr; use function is_int; use function ord; +use function sprintf; /** * Implements *RELATIVE-OID* type. diff --git a/src/ASN1/Type/Primitive/UTCTime.php b/src/ASN1/Type/Primitive/UTCTime.php index 87e18fa..dd31ba9 100644 --- a/src/ASN1/Type/Primitive/UTCTime.php +++ b/src/ASN1/Type/Primitive/UTCTime.php @@ -30,14 +30,14 @@ final class UTCTime extends BaseTime * @var string */ final public const REGEX = '#^' . - '(\d\d)' . // YY - '(\d\d)' . // MM - '(\d\d)' . // DD - '(\d\d)' . // hh - '(\d\d)' . // mm - '(\d\d)' . // ss - 'Z' . // TZ - '$#'; + '(\d\d)' . // YY + '(\d\d)' . // MM + '(\d\d)' . // DD + '(\d\d)' . // hh + '(\d\d)' . // mm + '(\d\d)' . // ss + 'Z' . // TZ + '$#'; private function __construct(DateTimeImmutable $dt) { diff --git a/src/ASN1/Type/Tagged/ImplicitlyTaggedType.php b/src/ASN1/Type/Tagged/ImplicitlyTaggedType.php index 359b6d1..38369aa 100644 --- a/src/ASN1/Type/Tagged/ImplicitlyTaggedType.php +++ b/src/ASN1/Type/Tagged/ImplicitlyTaggedType.php @@ -10,6 +10,7 @@ use SpomkyLabs\Pki\ASN1\Feature\ElementBase; use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType; use UnexpectedValueException; +use function sprintf; /** * Implements implicit tagging mode. diff --git a/src/ASN1/Type/UnspecifiedType.php b/src/ASN1/Type/UnspecifiedType.php index 9d7aa18..3fd310c 100644 --- a/src/ASN1/Type/UnspecifiedType.php +++ b/src/ASN1/Type/UnspecifiedType.php @@ -37,6 +37,7 @@ use SpomkyLabs\Pki\ASN1\Type\Tagged\ApplicationType; use SpomkyLabs\Pki\ASN1\Type\Tagged\PrivateType; use UnexpectedValueException; +use function sprintf; /** * Decorator class to wrap an element without already knowing the specific underlying type. diff --git a/src/CryptoBridge/Crypto/OpenSSLCrypto.php b/src/CryptoBridge/Crypto/OpenSSLCrypto.php index fe47b8f..65a5e87 100644 --- a/src/CryptoBridge/Crypto/OpenSSLCrypto.php +++ b/src/CryptoBridge/Crypto/OpenSSLCrypto.php @@ -17,6 +17,7 @@ use UnexpectedValueException; use function array_key_exists; use function mb_strlen; +use function sprintf; use const OPENSSL_ALGO_MD4; use const OPENSSL_ALGO_MD5; use const OPENSSL_ALGO_SHA1; diff --git a/src/CryptoEncoding/PEM.php b/src/CryptoEncoding/PEM.php index 3618a01..30ff392 100644 --- a/src/CryptoEncoding/PEM.php +++ b/src/CryptoEncoding/PEM.php @@ -47,15 +47,15 @@ final class PEM implements Stringable * @var string */ final public const PEM_REGEX = '/' . - /* line start */ - '(?:^|[\r\n])' . - /* header */ - '-----BEGIN (.+?)-----[\r\n]+' . - /* payload */ - '(.+?)' . - /* trailer */ - '[\r\n]+-----END \\1-----' . - '/ms'; + /* line start */ + '(?:^|[\r\n])' . + /* header */ + '-----BEGIN (.+?)-----[\r\n]+' . + /* payload */ + '(.+?)' . + /* trailer */ + '[\r\n]+-----END \\1-----' . + '/ms'; /** * @param string $type Content type diff --git a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/ECPublicKeyAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/ECPublicKeyAlgorithmIdentifier.php index 5571f61..38ae417 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/ECPublicKeyAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/ECPublicKeyAlgorithmIdentifier.php @@ -12,16 +12,14 @@ use UnexpectedValueException; /* -From RFC 5480 - 2.1.1. Unrestricted Algorithm Identifier and Parameters: - -The parameter for id-ecPublicKey is as follows and MUST always be -present: - -ECParameters ::= CHOICE { - namedCurve OBJECT IDENTIFIER - -- implicitCurve NULL - -- specifiedCurve SpecifiedECDomain -} + * From RFC 5480 - 2.1.1. Unrestricted Algorithm Identifier and Parameters: + * The parameter for id-ecPublicKey is as follows and MUST always be + * present: + * ECParameters ::= CHOICE { + * namedCurve OBJECT IDENTIFIER + * -- implicitCurve NULL + * -- specifiedCurve SpecifiedECDomain + * } */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410EdAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410EdAlgorithmIdentifier.php index 133f6b9..3821fea 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410EdAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410EdAlgorithmIdentifier.php @@ -10,16 +10,14 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; /* -From RFC 8410: - - For all of the OIDs, the parameters MUST be absent. - - It is possible to find systems that require the parameters to be - present. This can be due to either a defect in the original 1997 - syntax or a programming error where developers never got input where - this was not true. The optimal solution is to fix these systems; - where this is not possible, the problem needs to be restricted to - that subsystem and not propagated to the Internet. + * From RFC 8410: + * For all of the OIDs, the parameters MUST be absent. + * It is possible to find systems that require the parameters to be + * present. This can be due to either a defect in the original 1997 + * syntax or a programming error where developers never got input where + * this was not true. The optimal solution is to fix these systems; + * where this is not possible, the problem needs to be restricted to + * that subsystem and not propagated to the Internet. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410XAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410XAlgorithmIdentifier.php index f41bb45..a3f2a84 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410XAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RFC8410XAlgorithmIdentifier.php @@ -9,16 +9,14 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; /* -From RFC 8410: - - For all of the OIDs, the parameters MUST be absent. - - It is possible to find systems that require the parameters to be - present. This can be due to either a defect in the original 1997 - syntax or a programming error where developers never got input where - this was not true. The optimal solution is to fix these systems; - where this is not possible, the problem needs to be restricted to - that subsystem and not propagated to the Internet. + * From RFC 8410: + * For all of the OIDs, the parameters MUST be absent. + * It is possible to find systems that require the parameters to be + * present. This can be due to either a defect in the original 1997 + * syntax or a programming error where developers never got input where + * this was not true. The optimal solution is to fix these systems; + * where this is not possible, the problem needs to be restricted to + * that subsystem and not propagated to the Internet. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php index 3e87e88..c0631ec 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAEncryptionAlgorithmIdentifier.php @@ -12,10 +12,9 @@ use UnexpectedValueException; /* -From RFC 3447: - - When rsaEncryption is used in an AlgorithmIdentifier the - parameters MUST be present and MUST be NULL. + * From RFC 3447: + * When rsaEncryption is used in an AlgorithmIdentifier the + * parameters MUST be present and MUST be NULL. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php index 34aebd0..f1507a2 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Asymmetric/RSAPSSSSAEncryptionAlgorithmIdentifier.php @@ -12,10 +12,9 @@ use UnexpectedValueException; /* -From RFC 3447: - - When rsaEncryption is used in an AlgorithmIdentifier the - parameters MUST be present and MUST be NULL. + * From RFC 3447: + * When rsaEncryption is used in an AlgorithmIdentifier the + * parameters MUST be present and MUST be NULL. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Cipher/AESCBCAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Cipher/AESCBCAlgorithmIdentifier.php index f1e9f5a..b14322d 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Cipher/AESCBCAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Cipher/AESCBCAlgorithmIdentifier.php @@ -8,11 +8,9 @@ use SpomkyLabs\Pki\ASN1\Type\Primitive\OctetString; /* -From RFC 3565 - 4.1. AES Algorithm Identifiers and Parameters: - -The AlgorithmIdentifier parameters field MUST be present, and the parameter field MUST contain a AES-IV: - - AES-IV ::= OCTET STRING (SIZE(16)) + * From RFC 3565 - 4.1. AES Algorithm Identifiers and Parameters: + * The AlgorithmIdentifier parameters field MUST be present, and the parameter field MUST contain a AES-IV: + * AES-IV ::= OCTET STRING (SIZE(16)) */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php index efd7fbf..0e7c5ed 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESCBCAlgorithmIdentifier.php @@ -12,9 +12,8 @@ use UnexpectedValueException; /* -RFC 2898 defines parameters as follows: - -{OCTET STRING (SIZE(8)) IDENTIFIED BY desCBC} + * RFC 2898 defines parameters as follows: + * {OCTET STRING (SIZE(8)) IDENTIFIED BY desCBC} */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php index 705475d..a404f19 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Cipher/DESEDE3CBCAlgorithmIdentifier.php @@ -12,9 +12,8 @@ use UnexpectedValueException; /* -RFC 2898 defines parameters as follows: - -{OCTET STRING (SIZE(8)) IDENTIFIED BY des-EDE3-CBC} + * RFC 2898 defines parameters as follows: + * {OCTET STRING (SIZE(8)) IDENTIFIED BY des-EDE3-CBC} */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php index d8d1043..33d0a0b 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Cipher/RC2CBCAlgorithmIdentifier.php @@ -14,28 +14,25 @@ use UnexpectedValueException; /* -Parameters may be seen in various forms. This implementation attemts -to take them all into consideration. - -# RFC 2268 - A Description of the RC2(r) Encryption Algorithm -RC2-CBCParameter ::= CHOICE { - iv IV, - params SEQUENCE { - version RC2Version, - iv IV - } -} - -# RFC 2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0 -RC2-CBC-Parameter ::= SEQUENCE { - rc2ParameterVersion INTEGER OPTIONAL, - iv OCTET STRING (SIZE(8)) -} - -# RFC 3370 - Cryptographic Message Syntax (CMS) Algorithms -RC2CBCParameter ::= SEQUENCE { - rc2ParameterVersion INTEGER, - iv OCTET STRING } -- exactly 8 octets + * Parameters may be seen in various forms. This implementation attemts + * to take them all into consideration. + * # RFC 2268 - A Description of the RC2(r) Encryption Algorithm + * RC2-CBCParameter ::= CHOICE { + * iv IV, + * params SEQUENCE { + * version RC2Version, + * iv IV + * } + * } + * # RFC 2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0 + * RC2-CBC-Parameter ::= SEQUENCE { + * rc2ParameterVersion INTEGER OPTIONAL, + * iv OCTET STRING (SIZE(8)) + * } + * # RFC 3370 - Cryptographic Message Syntax (CMS) Algorithms + * RC2CBCParameter ::= SEQUENCE { + * rc2ParameterVersion INTEGER, + * iv OCTET STRING } -- exactly 8 octets */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Hash/HMACWithSHA1AlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Hash/HMACWithSHA1AlgorithmIdentifier.php index 4abf790..74a28a0 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Hash/HMACWithSHA1AlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Hash/HMACWithSHA1AlgorithmIdentifier.php @@ -12,10 +12,9 @@ use UnexpectedValueException; /* -Per RFC 2898 this algorithm identifier has no parameters: - -algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::= - {algorithm id-hmacWithSHA1, parameters NULL : NULL} + * Per RFC 2898 this algorithm identifier has no parameters: + * algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::= + * {algorithm id-hmacWithSHA1, parameters NULL : NULL} */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Hash/MD5AlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Hash/MD5AlgorithmIdentifier.php index 94345cf..4fae45d 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Hash/MD5AlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Hash/MD5AlgorithmIdentifier.php @@ -11,17 +11,14 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; /* -From RFC 1321 - 1. Executive Summary - - In the X.509 type AlgorithmIdentifier, the parameters for MD5 - should have type NULL. - -From RFC 3370 - 2.2 MD5 - - The AlgorithmIdentifier parameters field MUST be present, and the - parameters field MUST contain NULL. Implementations MAY accept the - MD5 AlgorithmIdentifiers with absent parameters as well as NULL - parameters. + * From RFC 1321 - 1. Executive Summary + * In the X.509 type AlgorithmIdentifier, the parameters for MD5 + * should have type NULL. + * From RFC 3370 - 2.2 MD5 + * The AlgorithmIdentifier parameters field MUST be present, and the + * parameters field MUST contain NULL. Implementations MAY accept the + * MD5 AlgorithmIdentifiers with absent parameters as well as NULL + * parameters. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA1AlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA1AlgorithmIdentifier.php index 2eec340..a079f34 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA1AlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA1AlgorithmIdentifier.php @@ -11,14 +11,13 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; /* -From RFC 3370 - 2.1 SHA-1 - - The AlgorithmIdentifier parameters field is OPTIONAL. If present, - the parameters field MUST contain a NULL. Implementations MUST - accept SHA-1 AlgorithmIdentifiers with absent parameters. - Implementations MUST accept SHA-1 AlgorithmIdentifiers with NULL - parameters. Implementations SHOULD generate SHA-1 - AlgorithmIdentifiers with absent parameters. + * From RFC 3370 - 2.1 SHA-1 + * The AlgorithmIdentifier parameters field is OPTIONAL. If present, + * the parameters field MUST contain a NULL. Implementations MUST + * accept SHA-1 AlgorithmIdentifiers with absent parameters. + * Implementations MUST accept SHA-1 AlgorithmIdentifiers with NULL + * parameters. Implementations SHOULD generate SHA-1 + * AlgorithmIdentifiers with absent parameters. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA2AlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA2AlgorithmIdentifier.php index 9792141..679cefb 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA2AlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Hash/SHA2AlgorithmIdentifier.php @@ -10,13 +10,12 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; /* -From RFC 5754 - 2. Message Digest Algorithms - - The AlgorithmIdentifier parameters field is OPTIONAL. - Implementations MUST accept SHA2 AlgorithmIdentifiers with absent - parameters. Implementations MUST accept SHA2 AlgorithmIdentifiers - with NULL parameters. Implementations MUST generate SHA2 - AlgorithmIdentifiers with absent parameters. + * From RFC 5754 - 2. Message Digest Algorithms + * The AlgorithmIdentifier parameters field is OPTIONAL. + * Implementations MUST accept SHA2 AlgorithmIdentifiers with absent + * parameters. Implementations MUST accept SHA2 AlgorithmIdentifiers + * with NULL parameters. Implementations MUST generate SHA2 + * AlgorithmIdentifiers with absent parameters. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Signature/ECSignatureAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Signature/ECSignatureAlgorithmIdentifier.php index da2ca03..6ffe33b 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Signature/ECSignatureAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Signature/ECSignatureAlgorithmIdentifier.php @@ -10,12 +10,11 @@ use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; /* -From RFC 5758 - 3.2. ECDSA Signature Algorithm - - When the ecdsa-with-SHA224, ecdsa-with-SHA256, ecdsa-with-SHA384, or - ecdsa-with-SHA512 algorithm identifier appears in the algorithm field - as an AlgorithmIdentifier, the encoding MUST omit the parameters - field. + * From RFC 5758 - 3.2. ECDSA Signature Algorithm + * When the ecdsa-with-SHA224, ecdsa-with-SHA256, ecdsa-with-SHA384, or + * ecdsa-with-SHA512 algorithm identifier appears in the algorithm field + * as an AlgorithmIdentifier, the encoding MUST omit the parameters + * field. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC3279RSASignatureAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC3279RSASignatureAlgorithmIdentifier.php index 9200889..d717d8c 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC3279RSASignatureAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC3279RSASignatureAlgorithmIdentifier.php @@ -8,11 +8,10 @@ use SpomkyLabs\Pki\ASN1\Type\Primitive\NullType; /* -From RFC 3279 - 2.2.1 RSA Signature Algorithm: - - When any of these three OIDs appears within the ASN.1 type - AlgorithmIdentifier, the parameters component of that type SHALL be - the ASN.1 type NULL. + * From RFC 3279 - 2.2.1 RSA Signature Algorithm: + * When any of these three OIDs appears within the ASN.1 type + * AlgorithmIdentifier, the parameters component of that type SHALL be + * the ASN.1 type NULL. */ /** diff --git a/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC4055RSASignatureAlgorithmIdentifier.php b/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC4055RSASignatureAlgorithmIdentifier.php index e9ae13b..de8abaf 100644 --- a/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC4055RSASignatureAlgorithmIdentifier.php +++ b/src/CryptoTypes/AlgorithmIdentifier/Signature/RFC4055RSASignatureAlgorithmIdentifier.php @@ -7,11 +7,10 @@ use SpomkyLabs\Pki\ASN1\Element; /* -From RFC 4055 - 5. PKCS #1 Version 1.5 Signature Algorithm - - When any of these four object identifiers appears within an - AlgorithmIdentifier, the parameters MUST be NULL. Implementations - MUST accept the parameters being absent as well as present. + * From RFC 4055 - 5. PKCS #1 Version 1.5 Signature Algorithm + * When any of these four object identifiers appears within an + * AlgorithmIdentifier, the parameters MUST be NULL. Implementations + * MUST accept the parameters being absent as well as present. */ /** diff --git a/src/X501/ASN1/Attribute.php b/src/X501/ASN1/Attribute.php index 093d43b..8e27b75 100644 --- a/src/X501/ASN1/Attribute.php +++ b/src/X501/ASN1/Attribute.php @@ -13,6 +13,7 @@ use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType; use SpomkyLabs\Pki\X501\ASN1\AttributeValue\AttributeValue; use function count; +use function sprintf; /** * Implements *Attribute* ASN.1 type. diff --git a/src/X501/ASN1/AttributeValue/Feature/DirectoryString.php b/src/X501/ASN1/AttributeValue/Feature/DirectoryString.php index d07891b..c7b8bf3 100644 --- a/src/X501/ASN1/AttributeValue/Feature/DirectoryString.php +++ b/src/X501/ASN1/AttributeValue/Feature/DirectoryString.php @@ -18,6 +18,7 @@ use SpomkyLabs\Pki\X501\StringPrep\TranscodeStep; use UnexpectedValueException; use function array_key_exists; +use function sprintf; /** * Base class for attribute values having *(Unbounded)DirectoryString* as a syntax. diff --git a/src/X501/DN/DNParser.php b/src/X501/DN/DNParser.php index 1e46412..d57f452 100644 --- a/src/X501/DN/DNParser.php +++ b/src/X501/DN/DNParser.php @@ -9,6 +9,7 @@ use SpomkyLabs\Pki\ASN1\Feature\ElementBase; use UnexpectedValueException; use function mb_strlen; +use function sprintf; /** * Distinguished Name parsing conforming to RFC 2253 and RFC 1779. diff --git a/src/X501/StringPrep/TranscodeStep.php b/src/X501/StringPrep/TranscodeStep.php index ff58611..0a74464 100644 --- a/src/X501/StringPrep/TranscodeStep.php +++ b/src/X501/StringPrep/TranscodeStep.php @@ -8,6 +8,7 @@ use SpomkyLabs\Pki\ASN1\Element; use SpomkyLabs\Pki\ASN1\Type\Primitive\T61String; use function in_array; +use function sprintf; /** * Implements 'Transcode' step of the Internationalized String Preparation as specified by RFC 4518. diff --git a/src/X509/GeneralName/IPv6Address.php b/src/X509/GeneralName/IPv6Address.php index a79983a..74194e2 100644 --- a/src/X509/GeneralName/IPv6Address.php +++ b/src/X509/GeneralName/IPv6Address.php @@ -7,6 +7,7 @@ use UnexpectedValueException; use function array_slice; use function count; +use function sprintf; final class IPv6Address extends IPAddress { diff --git a/tests/ASN1/Component/LengthEncodeTest.php b/tests/ASN1/Component/LengthEncodeTest.php index bb0d3b7..c77c382 100644 --- a/tests/ASN1/Component/LengthEncodeTest.php +++ b/tests/ASN1/Component/LengthEncodeTest.php @@ -56,7 +56,7 @@ public function hugeLength() $largenum = BigInteger::fromBase(str_repeat('ff', 126), 16); $length = Length::create($largenum); $expected = "\xfe" . str_repeat("\xff", 126); - static::assertEquals($expected, $length->toDER()); + static::assertSame($expected, $length->toDER()); } #[Test] diff --git a/tests/ASN1/Type/Constructed/StructureTest.php b/tests/ASN1/Type/Constructed/StructureTest.php index 040d4fe..6d51f4c 100644 --- a/tests/ASN1/Type/Constructed/StructureTest.php +++ b/tests/ASN1/Type/Constructed/StructureTest.php @@ -27,7 +27,7 @@ final class StructureTest extends TestCase public function has(int $idx, bool $result) { $seq = Sequence::create(NullType::create(), Boolean::create(true), NullType::create()); - static::assertEquals($seq->has($idx), $result); + static::assertSame($seq->has($idx), $result); } public static function hasProvider(): Iterator @@ -43,7 +43,7 @@ public static function hasProvider(): Iterator public function hasType(int $idx, int $type, bool $result) { $seq = Sequence::create(NullType::create(), Boolean::create(true)); - static::assertEquals($seq->has($idx, $type), $result); + static::assertSame($seq->has($idx, $type), $result); } public static function hasTypeProvider(): Iterator diff --git a/tests/ASN1/Type/Primitive/Integer/EncodeTest.php b/tests/ASN1/Type/Primitive/Integer/EncodeTest.php index 6bc1edb..a0527ed 100644 --- a/tests/ASN1/Type/Primitive/Integer/EncodeTest.php +++ b/tests/ASN1/Type/Primitive/Integer/EncodeTest.php @@ -206,7 +206,7 @@ public function hugePositive() $num = BigInteger::fromBase('7f' . str_repeat('ff', 0xfffe), 16); $int = Integer::create($num); $der = "\x2\x82\xff\xff\x7f" . str_repeat("\xff", 0xfffe); - static::assertEquals($der, $int->toDER()); + static::assertSame($der, $int->toDER()); } #[Test] @@ -215,6 +215,6 @@ public function hugeNegative() $num = BigInteger::of(0)->minus(BigInteger::fromBase('80' . str_repeat('00', 0xfffe), 16)); $int = Integer::create($num); $der = "\x2\x82\xff\xff\x80" . str_repeat("\x00", 0xfffe); - static::assertEquals($der, $int->toDER()); + static::assertSame($der, $int->toDER()); } } diff --git a/tests/ASN1/Type/UnspecifiedTypeTest.php b/tests/ASN1/Type/UnspecifiedTypeTest.php index cd5485d..f99cf76 100644 --- a/tests/ASN1/Type/UnspecifiedTypeTest.php +++ b/tests/ASN1/Type/UnspecifiedTypeTest.php @@ -116,7 +116,7 @@ public function isConstructed() { $el = NullType::create(); $wrap = UnspecifiedType::create($el); - static::assertEquals($el->isConstructed(), $wrap->isConstructed()); + static::assertSame($el->isConstructed(), $wrap->isConstructed()); } #[Test] @@ -148,7 +148,7 @@ public function isTagged() { $el = NullType::create(); $wrap = UnspecifiedType::create($el); - static::assertEquals($el->isTagged(), $wrap->isTagged()); + static::assertSame($el->isTagged(), $wrap->isTagged()); } #[Test] diff --git a/tests/ASN1/Util/FlagsTest.php b/tests/ASN1/Util/FlagsTest.php index 000359c..6a34391 100644 --- a/tests/ASN1/Util/FlagsTest.php +++ b/tests/ASN1/Util/FlagsTest.php @@ -183,7 +183,7 @@ public static function bitStringToNumberProvider(): Iterator public function intNumber() { $flags = Flags::create(0x80, 16); - static::assertSame($flags->intNumber(), 128); + static::assertSame(128, $flags->intNumber()); } #[Test] diff --git a/tests/X509/Unit/Certificate/CertificateChainTest.php b/tests/X509/Unit/Certificate/CertificateChainTest.php index 9754749..7e84d11 100644 --- a/tests/X509/Unit/Certificate/CertificateChainTest.php +++ b/tests/X509/Unit/Certificate/CertificateChainTest.php @@ -12,6 +12,7 @@ use SpomkyLabs\Pki\X509\Certificate\Certificate; use SpomkyLabs\Pki\X509\Certificate\CertificateChain; use SpomkyLabs\Pki\X509\CertificationPath\CertificationPath; +use function sprintf; /** * @internal diff --git a/tests/X509/Unit/Certificate/CertificateVersionTest.php b/tests/X509/Unit/Certificate/CertificateVersionTest.php index 88c3486..c68f972 100644 --- a/tests/X509/Unit/Certificate/CertificateVersionTest.php +++ b/tests/X509/Unit/Certificate/CertificateVersionTest.php @@ -46,7 +46,7 @@ public static function tearDownAfterClass(): void public function version1() { $cert = self::$_tbsCert->sign(SHA1WithRSAEncryptionAlgorithmIdentifier::create(), self::$_privateKeyInfo); - static::assertSame($cert->tbsCertificate()->version(), TBSCertificate::VERSION_1); + static::assertSame(TBSCertificate::VERSION_1, $cert->tbsCertificate()->version()); } #[Test] @@ -54,7 +54,7 @@ public function version2SubjectUID() { $tbsCert = self::$_tbsCert->withSubjectUniqueID(UniqueIdentifier::fromString('subject')); $cert = $tbsCert->sign(SHA1WithRSAEncryptionAlgorithmIdentifier::create(), self::$_privateKeyInfo); - static::assertSame($cert->tbsCertificate()->version(), TBSCertificate::VERSION_2); + static::assertSame(TBSCertificate::VERSION_2, $cert->tbsCertificate()->version()); } #[Test] @@ -62,7 +62,7 @@ public function version2IssuerUID() { $tbsCert = self::$_tbsCert->withIssuerUniqueID(UniqueIdentifier::fromString('issuer')); $cert = $tbsCert->sign(SHA1WithRSAEncryptionAlgorithmIdentifier::create(), self::$_privateKeyInfo); - static::assertSame($cert->tbsCertificate()->version(), TBSCertificate::VERSION_2); + static::assertSame(TBSCertificate::VERSION_2, $cert->tbsCertificate()->version()); } #[Test] @@ -72,7 +72,7 @@ public function version2BothUID() UniqueIdentifier::fromString('subject') )->withIssuerUniqueID(UniqueIdentifier::fromString('issuer')); $cert = $tbsCert->sign(SHA1WithRSAEncryptionAlgorithmIdentifier::create(), self::$_privateKeyInfo); - static::assertSame($cert->tbsCertificate()->version(), TBSCertificate::VERSION_2); + static::assertSame(TBSCertificate::VERSION_2, $cert->tbsCertificate()->version()); } #[Test] @@ -82,6 +82,6 @@ public function version3() Extensions::create(KeyUsageExtension::create(true, KeyUsageExtension::DIGITAL_SIGNATURE)) ); $cert = $tbsCert->sign(SHA1WithRSAEncryptionAlgorithmIdentifier::create(), self::$_privateKeyInfo); - static::assertSame($cert->tbsCertificate()->version(), TBSCertificate::VERSION_3); + static::assertSame(TBSCertificate::VERSION_3, $cert->tbsCertificate()->version()); } }