From 675a7fa0da9077f7077d7bbe8b47025df243376e Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Sat, 1 Jun 2024 12:07:36 +0200 Subject: [PATCH] bring the realpath back (#22) * bring the realpath back * fix return type * add cs fixer cache * run cs fixer --- .gitignore | 1 + src/Base64/Base64Parser.php | 4 +++- src/Base64/SafeBase64Parser.php | 4 +++- .../Algorithms/Ecdsa/AbstractEcdsaSigner.php | 5 ++++- .../Algorithms/Ecdsa/AbstractEcdsaVerifier.php | 5 ++++- .../Algorithms/Ecdsa/Algorithm.php | 4 +++- .../Algorithms/Ecdsa/ES256KVerifier.php | 4 +++- .../Algorithms/Ecdsa/ES256Signer.php | 4 +++- .../Algorithms/Ecdsa/ES256Verifier.php | 4 +++- .../Algorithms/Ecdsa/ES384Signer.php | 4 +++- .../Algorithms/Ecdsa/ES384Verifier.php | 4 +++- .../Algorithms/Eddsa/EdDsaSigner.php | 5 ++++- .../Algorithms/Eddsa/EdDsaVerifier.php | 4 +++- .../Algorithms/Hmac/AbstractHmac.php | 4 +++- src/Cryptography/Algorithms/Hmac/HS256.php | 4 +++- src/Cryptography/Algorithms/Hmac/HS384.php | 4 +++- src/Cryptography/Algorithms/Hmac/HS512.php | 4 +++- .../Algorithms/Rsa/AbstractRsaSigner.php | 4 +++- .../Algorithms/Rsa/AbstractRsaVerifier.php | 4 +++- src/Cryptography/Algorithms/Rsa/Algorithm.php | 4 +++- .../Algorithms/Rsa/RS256Signer.php | 4 +++- .../Algorithms/Rsa/RS256Verifier.php | 4 +++- .../Algorithms/Rsa/RS384Signer.php | 4 +++- .../Algorithms/Rsa/RS384Verifier.php | 4 +++- .../Algorithms/Rsa/RS512Signer.php | 4 +++- .../Algorithms/Rsa/RS512Verifier.php | 4 +++- src/Cryptography/Keys/EcdsaPrivateKey.php | 11 ++++++----- src/Cryptography/Keys/EcdsaPublicKey.php | 11 ++++++----- src/Cryptography/Keys/EdDsaPrivateKey.php | 4 +++- src/Cryptography/Keys/EdDsaPublicKey.php | 4 +++- src/Cryptography/Keys/HmacKey.php | 4 +++- src/Cryptography/Keys/RsaPrivateKey.php | 11 ++++++----- src/Cryptography/Keys/RsaPublicKey.php | 11 ++++++----- src/Cryptography/Signer.php | 4 +++- src/Cryptography/Verifier.php | 4 +++- src/Enums/PublicClaimNames.php | 18 ++++++++++-------- src/Exceptions/InvalidKeyException.php | 4 +++- src/Exceptions/InvalidSignatureException.php | 4 +++- src/Exceptions/InvalidTokenException.php | 4 +++- src/Exceptions/JsonDecodingException.php | 4 +++- src/Exceptions/JsonEncodingException.php | 4 +++- src/Exceptions/NoKidException.php | 4 +++- src/Exceptions/SigningException.php | 4 +++- src/Exceptions/ValidationException.php | 4 +++- src/Exceptions/VerifierNotFoundException.php | 4 +++- src/Generator.php | 4 +++- src/Json/JsonParser.php | 4 +++- src/Json/StrictJsonParser.php | 4 +++- src/Parser.php | 7 ++++--- src/Validator/BaseValidator.php | 4 +++- src/Validator/DefaultValidator.php | 4 +++- src/Validator/Rule.php | 4 +++- src/Validator/Rules/ConsistsOf.php | 4 +++- src/Validator/Rules/EqualsTo.php | 4 +++- src/Validator/Rules/GreaterThan.php | 4 +++- src/Validator/Rules/GreaterThanOrEqualTo.php | 4 +++- src/Validator/Rules/IdenticalTo.php | 4 +++- src/Validator/Rules/LessThan.php | 4 +++- src/Validator/Rules/LessThanOrEqualTo.php | 4 +++- src/Validator/Rules/NewerThan.php | 4 +++- src/Validator/Rules/NewerThanOrSame.php | 4 +++- src/Validator/Rules/NotEmpty.php | 4 +++- src/Validator/Rules/NotNull.php | 4 +++- src/Validator/Rules/OlderThan.php | 4 +++- src/Validator/Rules/OlderThanOrSame.php | 4 +++- src/Validator/Validator.php | 4 +++- src/VerifierFactory.php | 2 +- 67 files changed, 220 insertions(+), 91 deletions(-) diff --git a/.gitignore b/.gitignore index 7af493e..c5bf2a4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ /build /vendor .DS_Store +.php-cs-fixer.cache .phpunit.result.cache composer.lock diff --git a/src/Base64/Base64Parser.php b/src/Base64/Base64Parser.php index edd8496..e0c81df 100644 --- a/src/Base64/Base64Parser.php +++ b/src/Base64/Base64Parser.php @@ -1,4 +1,6 @@ -resource = openssl_pkey_get_private($content, $passphrase); if ($this->resource === false) { @@ -34,7 +35,7 @@ public function __construct(string $key, string $passphrase = '', ?string $id = } /** - * @return mixed + * @return resource */ public function getResource() { diff --git a/src/Cryptography/Keys/EcdsaPublicKey.php b/src/Cryptography/Keys/EcdsaPublicKey.php index 0e43fca..c2b21ff 100644 --- a/src/Cryptography/Keys/EcdsaPublicKey.php +++ b/src/Cryptography/Keys/EcdsaPublicKey.php @@ -1,14 +1,15 @@ -resource = openssl_pkey_get_public($content); if ($this->resource === false) { @@ -33,7 +34,7 @@ public function __construct(string $key, ?string $id = null) } /** - * @return mixed + * @return resource */ public function getResource() { diff --git a/src/Cryptography/Keys/EdDsaPrivateKey.php b/src/Cryptography/Keys/EdDsaPrivateKey.php index 6619565..7c60bb5 100644 --- a/src/Cryptography/Keys/EdDsaPrivateKey.php +++ b/src/Cryptography/Keys/EdDsaPrivateKey.php @@ -1,4 +1,6 @@ -resource = openssl_pkey_get_private($content, $passphrase); if ($this->resource === false) { @@ -34,7 +35,7 @@ public function __construct(string $key, string $passphrase = '', ?string $id = } /** - * @return mixed + * @return resource */ public function getResource() { diff --git a/src/Cryptography/Keys/RsaPublicKey.php b/src/Cryptography/Keys/RsaPublicKey.php index 92b5e8a..0b9602a 100644 --- a/src/Cryptography/Keys/RsaPublicKey.php +++ b/src/Cryptography/Keys/RsaPublicKey.php @@ -1,14 +1,15 @@ -resource = openssl_pkey_get_public($content); if ($this->resource === false) { @@ -33,7 +34,7 @@ public function __construct(string $key, ?string $id = null) } /** - * @return mixed + * @return resource */ public function getResource() { diff --git a/src/Cryptography/Signer.php b/src/Cryptography/Signer.php index 63a9a66..0ee04fc 100644 --- a/src/Cryptography/Signer.php +++ b/src/Cryptography/Signer.php @@ -1,4 +1,6 @@ -verifier = $verifier; $this->validator = $validator ?: new DefaultValidator(); $this->jsonParser = $jsonParser ?: new StrictJsonParser(); diff --git a/src/Validator/BaseValidator.php b/src/Validator/BaseValidator.php index a703d86..adb6be7 100644 --- a/src/Validator/BaseValidator.php +++ b/src/Validator/BaseValidator.php @@ -1,4 +1,6 @@ -