diff --git a/ecs.php b/ecs.php index 0e1998774..c04401031 100644 --- a/ecs.php +++ b/ecs.php @@ -2,7 +2,6 @@ declare(strict_types=1); -use PhpCsFixer\Fixer\Alias\MbStrFunctionsFixer; use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; use PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer; use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; @@ -30,6 +29,8 @@ use Symplify\EasyCodingStandard\Config\ECSConfig; use Symplify\EasyCodingStandard\ValueObject\Set\SetList; +//use PhpCsFixer\Fixer\Alias\MbStrFunctionsFixer; + return static function (ECSConfig $config): void { $header = ''; $config->import(SetList::PSR_12); @@ -53,7 +54,7 @@ $config->rule(ProtectedToPrivateFixer::class); $config->rule(DeclareStrictTypesFixer::class); $config->rule(NativeConstantInvocationFixer::class); - $config->rule(MbStrFunctionsFixer::class); + //$config->rule(MbStrFunctionsFixer::class); $config->rule(LinebreakAfterOpeningTagFixer::class); $config->rule(CombineConsecutiveIssetsFixer::class); $config->rule(CombineConsecutiveUnsetsFixer::class); diff --git a/performance/JWE/EncryptionBench.php b/performance/JWE/EncryptionBench.php index a253df1b0..f7b47579e 100644 --- a/performance/JWE/EncryptionBench.php +++ b/performance/JWE/EncryptionBench.php @@ -46,9 +46,7 @@ */ abstract class EncryptionBench { - private AlgorithmManager $contentEncryptionAlgorithmsManager; - - private AlgorithmManager $keyEncryptionAlgorithmsManager; + private AlgorithmManager $algorithmsManager; private CompressionMethodManager $compressionMethodsManager; @@ -56,7 +54,8 @@ abstract class EncryptionBench public function init(): void { - $this->keyEncryptionAlgorithmsManager = new AlgorithmManager([ + $this->algorithmsManager = new AlgorithmManager([ + // Key Encryption new A128KW(), new A192KW(), new A256KW(), @@ -74,8 +73,8 @@ public function init(): void new RSA15(), new RSAOAEP(), new RSAOAEP256(), - ]); - $this->contentEncryptionAlgorithmsManager = new AlgorithmManager([ + + // Content Encryption new A128CBCHS256(), new A192CBCHS384(), new A256CBCHS512(), @@ -97,11 +96,7 @@ public function init(): void */ public function encryption(array $params): void { - $jweBuilder = new JWEBuilder( - $this->getKeyEncryptionAlgorithmsManager(), - $this->getContentEncryptionAlgorithmsManager(), - $this->getCompressionMethodsManager() - ); + $jweBuilder = new JWEBuilder($this->getAlgorithmsManager(), $this->getCompressionMethodsManager()); $jweBuilder ->withPayload($params['payload']) ->withAAD($this->getAAD()) @@ -118,11 +113,7 @@ public function encryption(array $params): void */ public function decryption(array $params): void { - $jweLoader = new JWEDecrypter( - $this->getKeyEncryptionAlgorithmsManager(), - $this->getContentEncryptionAlgorithmsManager(), - $this->getCompressionMethodsManager() - ); + $jweLoader = new JWEDecrypter($this->getAlgorithmsManager(), $this->getCompressionMethodsManager()); $jwe = $this->serializerManager->unserialize($params['input']); $keyset = JWKSet::createFromKeyData($params['recipient_keys']); $jweLoader->decryptUsingKeySet($jwe, $keyset, 0); @@ -143,14 +134,9 @@ abstract public function dataRecipientPublicKeys(): array; abstract protected function getAAD(): ?string; - private function getKeyEncryptionAlgorithmsManager(): AlgorithmManager - { - return $this->keyEncryptionAlgorithmsManager; - } - - private function getContentEncryptionAlgorithmsManager(): AlgorithmManager + private function getAlgorithmsManager(): AlgorithmManager { - return $this->contentEncryptionAlgorithmsManager; + return $this->algorithmsManager; } private function getCompressionMethodsManager(): CompressionMethodManager diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7bce3abb8..6a45691fd 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,10 +1,80 @@ parameters: ignoreErrors: + - + message: "#^Parameter \\#1 \\$data of method Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\CheckerCollector\\:\\:collectHeaderCheckerManagers\\(\\) expects array\\\\>, array\\ given\\.$#" + count: 1 + path: src/Bundle/DataCollector/CheckerCollector.php + + - + message: """ + #^Call to deprecated method collectSupportedCompressionMethods\\(\\) of class Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\JWECollector\\: + This method is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/DataCollector/JWECollector.php + + - + message: """ + #^Call to deprecated method getCompressionMethodManager\\(\\) of class Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\: + This method is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/DataCollector/JWECollector.php + + - + message: """ + #^Call to deprecated method getCompressionMethodManager\\(\\) of class Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\: + This method is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 2 + path: src/Bundle/DataCollector/JWECollector.php + + - + message: "#^Cannot call method list\\(\\) on Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\|null\\.$#" + count: 3 + path: src/Bundle/DataCollector/JWECollector.php + + - + message: "#^Parameter \\#1 \\$data of method Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\JWECollector\\:\\:collectSupportedCompressionMethods\\(\\) expects array\\\\>, array\\ given\\.$#" + count: 1 + path: src/Bundle/DataCollector/JWECollector.php + + - + message: """ + #^Parameter \\$compressionMethodManagerFactory of method Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\JWECollector\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/DataCollector/JWECollector.php + + - + message: "#^Parameter \\#1 \\$data of method Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\JWSCollector\\:\\:collectSupportedJWSSerializations\\(\\) expects array\\\\>, array\\ given\\.$#" + count: 1 + path: src/Bundle/DataCollector/JWSCollector.php + + - + message: "#^Parameter \\#1 \\$data of method Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\Collector\\:\\:collect\\(\\) expects array\\, array\\|Symfony\\\\Component\\\\VarDumper\\\\Cloner\\\\Data given\\.$#" + count: 1 + path: src/Bundle/DataCollector/JoseCollector.php + + - + message: "#^Parameter \\#1 \\$data of method Jose\\\\Bundle\\\\JoseFramework\\\\DataCollector\\\\KeyCollector\\:\\:collectJWK\\(\\) expects array\\\\>, array\\ given\\.$#" + count: 1 + path: src/Bundle/DataCollector/KeyCollector.php + - message: "#^Parameter \\#1 \\$jwk of method Jose\\\\Component\\\\KeyManagement\\\\Analyzer\\\\KeyAnalyzerManager\\:\\:analyze\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK, mixed given\\.$#" count: 1 path: src/Bundle/DataCollector/KeyCollector.php + - + message: """ + #^Fetching class constant class of deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 2 + path: src/Bundle/DependencyInjection/Compiler/CompressionMethodCompilerPass.php + - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\DependencyInjection\\\\JoseFrameworkExtension\\:\\:getConfiguration\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" count: 1 @@ -885,6 +955,22 @@ parameters: count: 1 path: src/Bundle/Resources/config/Algorithms/signature_experimental.php + - + message: """ + #^Fetching class constant class of deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/Resources/config/compression_methods.php + + - + message: """ + #^Fetching class constant class of deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\Deflate\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/Resources/config/compression_methods.php + - message: "#^Class Jose\\\\Bundle\\\\JoseFramework\\\\Routing\\\\JWKSetLoader has an uninitialized property \\$resolver\\. Give it default value or assign it in the constructor\\.$#" count: 1 @@ -980,6 +1066,35 @@ parameters: count: 1 path: src/Bundle/Services/ClaimCheckerManager.php + - + message: """ + #^Parameter \\$compressionManager of method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEBuilder\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/Services/JWEBuilder.php + + - + message: """ + #^Parameter \\$compressionMethodManagerFactory of method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEBuilderFactory\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/Services/JWEBuilderFactory.php + + - + message: "#^Parameter \\#3 \\$JWK of class Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWEDecryptionSuccessEvent constructor expects Jose\\\\Component\\\\Core\\\\JWK, Jose\\\\Component\\\\Core\\\\JWK\\|null given\\.$#" + count: 1 + path: src/Bundle/Services/JWEDecrypter.php + + - + message: """ + #^Parameter \\$compressionMethodManager of method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypter\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/Services/JWEDecrypter.php + - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" count: 1 @@ -995,6 +1110,19 @@ parameters: count: 1 path: src/Bundle/Services/JWEDecrypterFactory.php + - + message: """ + #^Parameter \\$compressionMethodManagerFactory of method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWEDecrypterFactory\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Bundle/Services/JWEDecrypterFactory.php + + - + message: "#^Parameter \\#4 \\$recipient of class Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWELoadingSuccessEvent constructor expects int, int\\|null given\\.$#" + count: 1 + path: src/Bundle/Services/JWELoader.php + - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" count: 1 @@ -1020,6 +1148,11 @@ parameters: count: 1 path: src/Bundle/Services/JWELoaderFactory.php + - + message: "#^Parameter \\#4 \\$signature of class Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWSLoadingSuccessEvent constructor expects int, int\\|null given\\.$#" + count: 1 + path: src/Bundle/Services/JWSLoader.php + - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSLoaderFactory\\:\\:create\\(\\) has parameter \\$algorithms with no value type specified in iterable type array\\.$#" count: 1 @@ -1035,6 +1168,11 @@ parameters: count: 1 path: src/Bundle/Services/JWSLoaderFactory.php + - + message: "#^Parameter \\#5 \\$JWK of class Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\JWSVerificationSuccessEvent constructor expects Jose\\\\Component\\\\Core\\\\JWK, Jose\\\\Component\\\\Core\\\\JWK\\|null given\\.$#" + count: 1 + path: src/Bundle/Services/JWSVerifier.php + - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\JWSVerifierFactory\\:\\:create\\(\\) has parameter \\$algorithms with no value type specified in iterable type array\\.$#" count: 1 @@ -1070,6 +1208,11 @@ parameters: count: 1 path: src/Bundle/Services/NestedTokenBuilderFactory.php + - + message: "#^Parameter \\#5 \\$signature of class Jose\\\\Bundle\\\\JoseFramework\\\\Event\\\\NestedTokenLoadingSuccessEvent constructor expects int, int\\|null given\\.$#" + count: 1 + path: src/Bundle/Services/NestedTokenLoader.php + - message: "#^Method Jose\\\\Bundle\\\\JoseFramework\\\\Services\\\\NestedTokenLoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" count: 1 @@ -1350,6 +1493,11 @@ parameters: count: 1 path: src/Library/Core/Util/RSAKey.php + - + message: "#^Method Jose\\\\Component\\\\Encryption\\\\Algorithm\\\\ContentEncryption\\\\AESCBCHS\\:\\:encryptContent\\(\\) never assigns null to &\\$tag so it can be removed from the by\\-ref type\\.$#" + count: 1 + path: src/Library/Encryption/Algorithm/ContentEncryption/AESCBCHS.php + - message: "#^Parameter \\#3 \\$length of function mb_substr expects int\\|null, float\\|int\\<1, max\\> given\\.$#" count: 1 @@ -1375,11 +1523,6 @@ parameters: count: 2 path: src/Library/Encryption/Algorithm/KeyEncryption/Util/RSACrypt.php - - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\:\\:__construct\\(\\) has parameter \\$methods with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Library/Encryption/Compression/CompressionMethodManager.php - - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWE\\:\\:__construct\\(\\) has parameter \\$recipients with no value type specified in iterable type array\\.$#" count: 1 @@ -1405,6 +1548,11 @@ parameters: count: 1 path: src/Library/Encryption/JWE.php + - + message: "#^Call to function is_countable\\(\\) with array will always evaluate to true\\.$#" + count: 2 + path: src/Library/Encryption/JWEBuilder.php + - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:addRecipient\\(\\) has parameter \\$recipientHeader with no value type specified in iterable type array\\.$#" count: 1 @@ -1515,6 +1663,14 @@ parameters: count: 2 path: src/Library/Encryption/JWEBuilder.php + - + message: """ + #^Parameter \\$compressionManager of method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Library/Encryption/JWEBuilder.php + - message: "#^Property Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:\\$recipients type has no value type specified in iterable type array\\.$#" count: 1 @@ -1530,6 +1686,22 @@ parameters: count: 1 path: src/Library/Encryption/JWEBuilder.php + - + message: """ + #^Return type of method Jose\\\\Component\\\\Encryption\\\\JWEBuilder\\:\\:getCompressionMethod\\(\\) has typehint with deprecated interface Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethod\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Library/Encryption/JWEBuilder.php + + - + message: """ + #^Parameter \\$compressionMethodManagerFactory of method Jose\\\\Component\\\\Encryption\\\\JWEBuilderFactory\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Library/Encryption/JWEBuilderFactory.php + - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:checkCompleteHeader\\(\\) has parameter \\$completeHeaders with no value type specified in iterable type array\\.$#" count: 1 @@ -1575,6 +1747,27 @@ parameters: count: 1 path: src/Library/Encryption/JWEDecrypter.php + - + message: """ + #^Parameter \\$compressionMethodManager of method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManager\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: "#^Parameter &\\$successJwk by\\-ref type of method Jose\\\\Component\\\\Encryption\\\\JWEDecrypter\\:\\:decryptRecipientKey\\(\\) expects Jose\\\\Component\\\\Core\\\\JWK\\|null, mixed given\\.$#" + count: 1 + path: src/Library/Encryption/JWEDecrypter.php + + - + message: """ + #^Parameter \\$compressionMethodManagerFactory of method Jose\\\\Component\\\\Encryption\\\\JWEDecrypterFactory\\:\\:__construct\\(\\) has typehint with deprecated class Jose\\\\Component\\\\Encryption\\\\Compression\\\\CompressionMethodManagerFactory\\: + This class is deprecated and will be removed in v4\\.0\\. Compression is not recommended for JWE\\.$# + """ + count: 1 + path: src/Library/Encryption/JWEDecrypterFactory.php + - message: "#^Method Jose\\\\Component\\\\Encryption\\\\JWELoaderFactory\\:\\:create\\(\\) has parameter \\$compressionMethods with no value type specified in iterable type array\\.$#" count: 1 @@ -1600,6 +1793,16 @@ parameters: count: 1 path: src/Library/Encryption/JWELoaderFactory.php + - + message: "#^Parameter &\\$protectedHeader by\\-ref type of method Jose\\\\Component\\\\Encryption\\\\JWETokenSupport\\:\\:retrieveTokenHeaders\\(\\) expects array\\, array given\\.$#" + count: 1 + path: src/Library/Encryption/JWETokenSupport.php + + - + message: "#^Parameter &\\$unprotectedHeader by\\-ref type of method Jose\\\\Component\\\\Encryption\\\\JWETokenSupport\\:\\:retrieveTokenHeaders\\(\\) expects array\\, array given\\.$#" + count: 2 + path: src/Library/Encryption/JWETokenSupport.php + - message: "#^Method Jose\\\\Component\\\\Encryption\\\\Recipient\\:\\:__construct\\(\\) has parameter \\$header with no value type specified in iterable type array\\.$#" count: 1 @@ -1920,6 +2123,11 @@ parameters: count: 2 path: src/Library/NestedToken/NestedTokenBuilder.php + - + message: "#^Parameter \\#2 \\$recipient of method Jose\\\\Component\\\\NestedToken\\\\NestedTokenLoader\\:\\:checkContentTypeHeader\\(\\) expects int, int\\|null given\\.$#" + count: 1 + path: src/Library/NestedToken/NestedTokenLoader.php + - message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and '' will always evaluate to false\\.$#" count: 1 @@ -1980,11 +2188,6 @@ parameters: count: 1 path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php - - - message: "#^Parameter \\#1 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\Serializer\\\\Serializer\\:\\:isPayloadEncoded\\(\\) expects array\\, array given\\.$#" - count: 1 - path: src/Library/Signature/Serializer/JSONFlattenedSerializer.php - - message: "#^Parameter \\#2 \\$protectedHeader of method Jose\\\\Component\\\\Signature\\\\JWS\\:\\:addSignature\\(\\) expects array\\{alg\\?\\: string, string\\?\\: mixed\\}, array given\\.$#" count: 1 diff --git a/src/Bundle/DataCollector/JWECollector.php b/src/Bundle/DataCollector/JWECollector.php index c7869d74e..1ac34b5ae 100644 --- a/src/Bundle/DataCollector/JWECollector.php +++ b/src/Bundle/DataCollector/JWECollector.php @@ -127,6 +127,7 @@ public function catchJweBuiltFailure(JWEBuiltFailureEvent $event): void /** * @param array> $data + * @deprecated This method is deprecated and will be removed in v4.0. Compression is not recommended for JWE. */ private function collectSupportedCompressionMethods(array &$data): void { diff --git a/src/Bundle/Helper/ConfigurationHelper.php b/src/Bundle/Helper/ConfigurationHelper.php index 61873e264..1d840ca48 100644 --- a/src/Bundle/Helper/ConfigurationHelper.php +++ b/src/Bundle/Helper/ConfigurationHelper.php @@ -128,7 +128,7 @@ public static function addJWSLoader( * @param string[] $jwe_serializers * @param string[] $key_encryption_algorithms * @param string[] $content_encryption_algorithms - * @param string[] $compression_methods + * @param null|string[] $compression_methods * @param string[] $jwe_header_checkers * @param string[] $jws_serializers * @param string[] $signature_algorithms @@ -140,7 +140,7 @@ public static function addNestedTokenLoader( array $jwe_serializers, array $key_encryption_algorithms, array $content_encryption_algorithms, - array $compression_methods, + null|array $compression_methods, array $jwe_header_checkers, array $jws_serializers, array $signature_algorithms, @@ -176,7 +176,7 @@ public static function addNestedTokenLoader( * @param string[] $jwe_serializers * @param string[] $key_encryption_algorithms * @param string[] $content_encryption_algorithms - * @param string[] $compression_methods + * @param null|string[] $compression_methods * @param string[] $jws_serializers * @param string[] $signature_algorithms */ @@ -186,7 +186,7 @@ public static function addNestedTokenBuilder( array $jwe_serializers, array $key_encryption_algorithms, array $content_encryption_algorithms, - array $compression_methods, + null|array $compression_methods, array $jws_serializers, array $signature_algorithms, bool $is_public = true, @@ -245,7 +245,7 @@ public static function addJWESerializer( * @param string[] $serializers * @param string[] $key_encryption_algorithms * @param string[] $content_encryption_algorithms - * @param string[] $compression_methods + * @param null|string[] $compression_methods * @param string[] $header_checkers */ public static function addJWELoader( @@ -254,7 +254,7 @@ public static function addJWELoader( array $serializers, array $key_encryption_algorithms, array $content_encryption_algorithms, - array $compression_methods, + null|array $compression_methods, array $header_checkers, bool $is_public = true, array $tags = [] diff --git a/src/Bundle/Resources/config/compression_methods.php b/src/Bundle/Resources/config/compression_methods.php index b98fd4d9a..91d0aca4b 100644 --- a/src/Bundle/Resources/config/compression_methods.php +++ b/src/Bundle/Resources/config/compression_methods.php @@ -14,9 +14,19 @@ ->autowire(); $container->set(CompressionMethodManagerFactory::class) + ->deprecate( + 'web-token/jwt-bundle', + '3.3.X', + 'The "%service_id%" service is deprecated and will be removed in version 4.0. Compression is not recommended for the JWE.' + ) ->public(); $container->set(Deflate::class) + ->deprecate( + 'web-token/jwt-bundle', + '3.3.X', + 'The "%service_id%" service is deprecated and will be removed in version 4.0. Compression is not recommended for the JWE.' + ) ->tag('jose.compression_method', [ 'alias' => 'DEF', ]); diff --git a/src/Bundle/Resources/views/data_collector/tab/jwe/compression_methods.html.twig b/src/Bundle/Resources/views/data_collector/tab/jwe/compression_methods.html.twig index 9caacbe38..66f83e245 100644 --- a/src/Bundle/Resources/views/data_collector/tab/jwe/compression_methods.html.twig +++ b/src/Bundle/Resources/views/data_collector/tab/jwe/compression_methods.html.twig @@ -1,7 +1,7 @@

Compression Methods

The compression methods are used to shrink the size of the tokens.
- Their use is optional, but may be needed in case of heavy payloads. + Their use is NOT recommended and will be removed in the next major release.

diff --git a/src/Bundle/Services/JWEBuilder.php b/src/Bundle/Services/JWEBuilder.php index 03e386d96..309dc5bbf 100644 --- a/src/Bundle/Services/JWEBuilder.php +++ b/src/Bundle/Services/JWEBuilder.php @@ -18,7 +18,7 @@ final class JWEBuilder extends BaseJWEBuilder public function __construct( AlgorithmManager $algorithmManager, null|AlgorithmManager $contentEncryptionAlgorithmManager, - CompressionMethodManager $compressionManager, + null|CompressionMethodManager $compressionManager, private readonly EventDispatcherInterface $eventDispatcher ) { parent::__construct($algorithmManager, $contentEncryptionAlgorithmManager, $compressionManager); diff --git a/src/Bundle/Services/JWEBuilderFactory.php b/src/Bundle/Services/JWEBuilderFactory.php index 756f9bf5b..eef507812 100644 --- a/src/Bundle/Services/JWEBuilderFactory.php +++ b/src/Bundle/Services/JWEBuilderFactory.php @@ -12,9 +12,16 @@ final class JWEBuilderFactory { public function __construct( private readonly AlgorithmManagerFactory $algorithmManagerFactory, - private readonly CompressionMethodManagerFactory $compressionMethodManagerFactory, + private readonly null|CompressionMethodManagerFactory $compressionMethodManagerFactory, private readonly EventDispatcherInterface $eventDispatcher ) { + if ($compressionMethodManagerFactory !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethodManagerFactory" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } } /** @@ -22,17 +29,26 @@ public function __construct( * * @param string[] $keyEncryptionAlgorithms * @param string[] $contentEncryptionAlgorithms - * @param string[] $compressionMethods + * @param null|string[] $compressionMethods */ public function create( array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods + null|array $compressionMethods = null ): JWEBuilder { $algorithmManager = $this->algorithmManagerFactory->create( array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms) ); - $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods); + if ($compressionMethods !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethods" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } + $compressionMethodManager = $compressionMethods === null ? null : $this->compressionMethodManagerFactory?->create( + $compressionMethods + ); return new JWEBuilder($algorithmManager, null, $compressionMethodManager, $this->eventDispatcher); } diff --git a/src/Bundle/Services/JWEDecrypter.php b/src/Bundle/Services/JWEDecrypter.php index 4e4c0c859..f1fc05c65 100644 --- a/src/Bundle/Services/JWEDecrypter.php +++ b/src/Bundle/Services/JWEDecrypter.php @@ -19,7 +19,7 @@ final class JWEDecrypter extends BaseJWEDecrypter public function __construct( AlgorithmManager $keyEncryptionAlgorithmManager, AlgorithmManager $contentEncryptionAlgorithmManager, - CompressionMethodManager $compressionMethodManager, + null|CompressionMethodManager $compressionMethodManager, private readonly EventDispatcherInterface $eventDispatcher ) { parent::__construct($keyEncryptionAlgorithmManager, $contentEncryptionAlgorithmManager, $compressionMethodManager); diff --git a/src/Bundle/Services/JWEDecrypterFactory.php b/src/Bundle/Services/JWEDecrypterFactory.php index 91d5d722a..16e6d67ca 100644 --- a/src/Bundle/Services/JWEDecrypterFactory.php +++ b/src/Bundle/Services/JWEDecrypterFactory.php @@ -12,19 +12,35 @@ final class JWEDecrypterFactory { public function __construct( private readonly AlgorithmManagerFactory $algorithmManagerFactory, - private readonly CompressionMethodManagerFactory $compressionMethodManagerFactory, + private readonly null|CompressionMethodManagerFactory $compressionMethodManagerFactory, private readonly EventDispatcherInterface $eventDispatcher ) { + if ($compressionMethodManagerFactory !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethodManagerFactory" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } } public function create( array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods + null|array $compressionMethods = null ): JWEDecrypter { $keyEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($keyEncryptionAlgorithms); $contentEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($contentEncryptionAlgorithms); - $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods); + if ($compressionMethods !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethods" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } + $compressionMethodManager = $compressionMethods === null ? null : $this->compressionMethodManagerFactory?->create( + $compressionMethods + ); return new JWEDecrypter( $keyEncryptionAlgorithmManager, diff --git a/src/Bundle/Services/JWELoaderFactory.php b/src/Bundle/Services/JWELoaderFactory.php index 0cdc33ac2..349cacf4c 100644 --- a/src/Bundle/Services/JWELoaderFactory.php +++ b/src/Bundle/Services/JWELoaderFactory.php @@ -21,7 +21,7 @@ public function create( array $serializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods, + null|array $compressionMethods, array $headerCheckers = [] ): JWELoader { $serializerManager = $this->jweSerializerManagerFactory->create($serializers); diff --git a/src/Bundle/Services/NestedTokenBuilderFactory.php b/src/Bundle/Services/NestedTokenBuilderFactory.php index 0635a0417..f0badc204 100644 --- a/src/Bundle/Services/NestedTokenBuilderFactory.php +++ b/src/Bundle/Services/NestedTokenBuilderFactory.php @@ -23,7 +23,7 @@ public function create( array $jwe_serializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods, + null|array $compressionMethods, array $jws_serializers, array $signatureAlgorithms ): NestedTokenBuilder { diff --git a/src/Bundle/Services/NestedTokenLoaderFactory.php b/src/Bundle/Services/NestedTokenLoaderFactory.php index 5496b2638..f00be3627 100644 --- a/src/Bundle/Services/NestedTokenLoaderFactory.php +++ b/src/Bundle/Services/NestedTokenLoaderFactory.php @@ -19,7 +19,7 @@ public function create( array $jweSerializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods, + null|array $compressionMethods, array $jweHeaderCheckers, array $jwsSerializers, array $signatureAlgorithms, diff --git a/src/Library/Checker/ClaimCheckerManager.php b/src/Library/Checker/ClaimCheckerManager.php index 5b7230d3e..64f0c405b 100644 --- a/src/Library/Checker/ClaimCheckerManager.php +++ b/src/Library/Checker/ClaimCheckerManager.php @@ -22,7 +22,7 @@ class ClaimCheckerManager /** * @param ClaimChecker[] $checkers */ - public function __construct(array $checkers) + public function __construct(iterable $checkers) { foreach ($checkers as $checker) { $this->add($checker); diff --git a/src/Library/Checker/HeaderCheckerManager.php b/src/Library/Checker/HeaderCheckerManager.php index 124bfe920..1b05be6e8 100644 --- a/src/Library/Checker/HeaderCheckerManager.php +++ b/src/Library/Checker/HeaderCheckerManager.php @@ -28,7 +28,7 @@ class HeaderCheckerManager * @param HeaderChecker[] $checkers * @param TokenTypeSupport[] $tokenTypes */ - public function __construct(array $checkers, array $tokenTypes) + public function __construct(iterable $checkers, iterable $tokenTypes) { foreach ($checkers as $checker) { $this->add($checker); diff --git a/src/Library/Core/AlgorithmManager.php b/src/Library/Core/AlgorithmManager.php index 147921b5e..c528c9b46 100644 --- a/src/Library/Core/AlgorithmManager.php +++ b/src/Library/Core/AlgorithmManager.php @@ -17,7 +17,7 @@ class AlgorithmManager /** * @param Algorithm[] $algorithms */ - public function __construct(array $algorithms) + public function __construct(iterable $algorithms) { foreach ($algorithms as $algorithm) { $this->add($algorithm); diff --git a/src/Library/Core/AlgorithmManagerFactory.php b/src/Library/Core/AlgorithmManagerFactory.php index 3854e668f..4303e512c 100644 --- a/src/Library/Core/AlgorithmManagerFactory.php +++ b/src/Library/Core/AlgorithmManagerFactory.php @@ -17,7 +17,7 @@ class AlgorithmManagerFactory /** * @param Algorithm[] $algorithms */ - public function __construct(array $algorithms = []) + public function __construct(iterable $algorithms = []) { foreach ($algorithms as $algorithm) { $this->add($algorithm->name(), $algorithm); diff --git a/src/Library/Encryption/Compression/CompressionMethod.php b/src/Library/Encryption/Compression/CompressionMethod.php index 85d2bf38a..16b316b47 100644 --- a/src/Library/Encryption/Compression/CompressionMethod.php +++ b/src/Library/Encryption/Compression/CompressionMethod.php @@ -4,6 +4,9 @@ namespace Jose\Component\Encryption\Compression; +/** + * @deprecated This class is deprecated and will be removed in v4.0. Compression is not recommended for JWE. + */ interface CompressionMethod { /** diff --git a/src/Library/Encryption/Compression/CompressionMethodManager.php b/src/Library/Encryption/Compression/CompressionMethodManager.php index 8a51e6a6b..3708e3a41 100644 --- a/src/Library/Encryption/Compression/CompressionMethodManager.php +++ b/src/Library/Encryption/Compression/CompressionMethodManager.php @@ -7,6 +7,9 @@ use InvalidArgumentException; use function array_key_exists; +/** + * @deprecated This class is deprecated and will be removed in v4.0. Compression is not recommended for JWE. + */ class CompressionMethodManager { /** @@ -14,7 +17,10 @@ class CompressionMethodManager */ private array $compressionMethods = []; - public function __construct(array $methods = []) + /** + * @param CompressionMethod[] $methods + */ + public function __construct(iterable $methods = []) { foreach ($methods as $method) { $this->add($method); diff --git a/src/Library/Encryption/Compression/CompressionMethodManagerFactory.php b/src/Library/Encryption/Compression/CompressionMethodManagerFactory.php index 806424ef9..592ae7bbb 100644 --- a/src/Library/Encryption/Compression/CompressionMethodManagerFactory.php +++ b/src/Library/Encryption/Compression/CompressionMethodManagerFactory.php @@ -6,6 +6,9 @@ use InvalidArgumentException; +/** + * @deprecated This class is deprecated and will be removed in v4.0. Compression is not recommended for JWE. + */ class CompressionMethodManagerFactory { /** diff --git a/src/Library/Encryption/Compression/Deflate.php b/src/Library/Encryption/Compression/Deflate.php index 3f8796851..5c3deaa4e 100644 --- a/src/Library/Encryption/Compression/Deflate.php +++ b/src/Library/Encryption/Compression/Deflate.php @@ -8,6 +8,9 @@ use Throwable; use function is_string; +/** + * @deprecated This class is deprecated and will be removed in v4.0. Compression is not recommended for JWE. + */ final class Deflate implements CompressionMethod { private int $compressionLevel = -1; diff --git a/src/Library/Encryption/JWEBuilder.php b/src/Library/Encryption/JWEBuilder.php index 73827c9c5..73d70d451 100644 --- a/src/Library/Encryption/JWEBuilder.php +++ b/src/Library/Encryption/JWEBuilder.php @@ -52,8 +52,15 @@ class JWEBuilder public function __construct( AlgorithmManager $algorithmManager, null|AlgorithmManager $contentEncryptionAlgorithmManager, - private readonly CompressionMethodManager $compressionManager + private readonly null|CompressionMethodManager $compressionManager = null ) { + if ($compressionManager !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionManager" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } if ($contentEncryptionAlgorithmManager !== null) { trigger_deprecation( 'web-token/jwt-library', @@ -113,8 +120,9 @@ public function getContentEncryptionAlgorithmManager(): AlgorithmManager /** * Returns the compression method manager. + * @deprecated This method is deprecated and will be removed in v4.0. Compression is not recommended for JWE. */ - public function getCompressionMethodManager(): CompressionMethodManager + public function getCompressionMethodManager(): null|CompressionMethodManager { return $this->compressionManager; } @@ -519,7 +527,7 @@ private function determineCEK(array &$additionalHeader): string private function getCompressionMethod(array $completeHeader): ?CompressionMethod { - if (! array_key_exists('zip', $completeHeader)) { + if ($this->compressionManager === null || ! array_key_exists('zip', $completeHeader)) { return null; } diff --git a/src/Library/Encryption/JWEBuilderFactory.php b/src/Library/Encryption/JWEBuilderFactory.php index 37f5d9b10..23f8de942 100644 --- a/src/Library/Encryption/JWEBuilderFactory.php +++ b/src/Library/Encryption/JWEBuilderFactory.php @@ -11,8 +11,15 @@ class JWEBuilderFactory { public function __construct( private readonly AlgorithmManagerFactory $algorithmManagerFactory, - private readonly CompressionMethodManagerFactory $compressionMethodManagerFactory + private readonly null|CompressionMethodManagerFactory $compressionMethodManagerFactory = null ) { + if ($compressionMethodManagerFactory !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethodManagerFactory" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } } /** @@ -21,16 +28,18 @@ public function __construct( * * @param string[] $keyEncryptionAlgorithms * @param string[] $contentEncryptionAlgorithm - * @param string[] $compressionMethods + * @param null|string[] $compressionMethods */ public function create( array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithm, - array $compressionMethods + null|array $compressionMethods ): JWEBuilder { $keyEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($keyEncryptionAlgorithms); $contentEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($contentEncryptionAlgorithm); - $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods); + $compressionMethodManager = $compressionMethods === null ? null : $this->compressionMethodManagerFactory?->create( + $compressionMethods + ); return new JWEBuilder( $keyEncryptionAlgorithmManager, diff --git a/src/Library/Encryption/JWEDecrypter.php b/src/Library/Encryption/JWEDecrypter.php index e688112ef..fdbe8d91b 100644 --- a/src/Library/Encryption/JWEDecrypter.php +++ b/src/Library/Encryption/JWEDecrypter.php @@ -31,8 +31,15 @@ class JWEDecrypter public function __construct( AlgorithmManager $algorithmManager, null|AlgorithmManager $contentEncryptionAlgorithmManager, - private readonly CompressionMethodManager $compressionMethodManager + private readonly null|CompressionMethodManager $compressionMethodManager = null ) { + if ($compressionMethodManager !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethodManager" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } if ($contentEncryptionAlgorithmManager !== null) { trigger_deprecation( 'web-token/jwt-library', @@ -75,8 +82,9 @@ public function getContentEncryptionAlgorithmManager(): AlgorithmManager /** * Returns the compression method manager. + * @deprecated This method is deprecated and will be removed in v4.0. Compression is not recommended for JWE. */ - public function getCompressionMethodManager(): CompressionMethodManager + public function getCompressionMethodManager(): null|CompressionMethodManager { return $this->compressionMethodManager; } @@ -270,12 +278,13 @@ private function decryptPayload( private function decompressIfNeeded(string $payload, array $completeHeaders): string { - if (array_key_exists('zip', $completeHeaders)) { - $compression_method = $this->compressionMethodManager->get($completeHeaders['zip']); - $payload = $compression_method->uncompress($payload); + if ($this->compressionMethodManager === null || ! array_key_exists('zip', $completeHeaders)) { + return $payload; } - return $payload; + $compression_method = $this->compressionMethodManager->get($completeHeaders['zip']); + + return $compression_method->uncompress($payload); } private function checkCompleteHeader(array $completeHeaders): void diff --git a/src/Library/Encryption/JWEDecrypterFactory.php b/src/Library/Encryption/JWEDecrypterFactory.php index a61ef3bae..f4e72ac84 100644 --- a/src/Library/Encryption/JWEDecrypterFactory.php +++ b/src/Library/Encryption/JWEDecrypterFactory.php @@ -11,8 +11,15 @@ class JWEDecrypterFactory { public function __construct( private readonly AlgorithmManagerFactory $algorithmManagerFactory, - private readonly CompressionMethodManagerFactory $compressionMethodManagerFactory + private readonly null|CompressionMethodManagerFactory $compressionMethodManagerFactory = null ) { + if ($compressionMethodManagerFactory !== null) { + trigger_deprecation( + 'web-token/jwt-library', + '3.3.0', + 'The parameter "$compressionMethodManagerFactory" is deprecated and will be removed in 4.0.0. Compression is not recommended for JWE. Please set "null" instead.' + ); + } } /** @@ -21,17 +28,19 @@ public function __construct( * * @param string[] $keyEncryptionAlgorithms * @param string[] $contentEncryptionAlgorithms - * @param string[] $compressionMethods + * @param null|string[] $compressionMethods */ public function create( array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods + null|array $compressionMethods ): JWEDecrypter { $algorithmManager = $this->algorithmManagerFactory->create( array_merge($keyEncryptionAlgorithms, $contentEncryptionAlgorithms) ); - $compressionMethodManager = $this->compressionMethodManagerFactory->create($compressionMethods); + $compressionMethodManager = $compressionMethods === null ? null : $this->compressionMethodManagerFactory?->create( + $compressionMethods + ); return new JWEDecrypter($algorithmManager, null, $compressionMethodManager); } diff --git a/src/Library/Encryption/JWELoaderFactory.php b/src/Library/Encryption/JWELoaderFactory.php index 818e2d486..dca68bbd3 100644 --- a/src/Library/Encryption/JWELoaderFactory.php +++ b/src/Library/Encryption/JWELoaderFactory.php @@ -24,7 +24,7 @@ public function create( array $serializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods, + null|array $compressionMethods, array $headerCheckers = [] ): JWELoader { $serializerManager = $this->jweSerializerManagerFactory->create($serializers); diff --git a/src/Library/Encryption/Serializer/JWESerializerManager.php b/src/Library/Encryption/Serializer/JWESerializerManager.php index 14641bbaa..5082c7988 100644 --- a/src/Library/Encryption/Serializer/JWESerializerManager.php +++ b/src/Library/Encryption/Serializer/JWESerializerManager.php @@ -17,7 +17,7 @@ class JWESerializerManager /** * @param JWESerializer[] $serializers */ - public function __construct(array $serializers) + public function __construct(iterable $serializers) { foreach ($serializers as $serializer) { $this->add($serializer); diff --git a/src/Library/NestedToken/NestedTokenBuilderFactory.php b/src/Library/NestedToken/NestedTokenBuilderFactory.php index 81269e829..a1167d914 100644 --- a/src/Library/NestedToken/NestedTokenBuilderFactory.php +++ b/src/Library/NestedToken/NestedTokenBuilderFactory.php @@ -26,7 +26,7 @@ public function __construct( * @param array $jwe_serializers * @param array $keyEncryptionAlgorithms * @param array $contentEncryptionAlgorithms - * @param array $compressionMethods + * @param null|array $compressionMethods * @param array $jws_serializers * @param array $signatureAlgorithms */ @@ -34,7 +34,7 @@ public function create( array $jwe_serializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods, + null|array $compressionMethods, array $jws_serializers, array $signatureAlgorithms ): NestedTokenBuilder { diff --git a/src/Library/NestedToken/NestedTokenLoaderFactory.php b/src/Library/NestedToken/NestedTokenLoaderFactory.php index eb2d7bd59..04455d95c 100644 --- a/src/Library/NestedToken/NestedTokenLoaderFactory.php +++ b/src/Library/NestedToken/NestedTokenLoaderFactory.php @@ -22,7 +22,7 @@ public function __construct( * @param array $jweSerializers * @param array $keyEncryptionAlgorithms * @param array $contentEncryptionAlgorithms - * @param array $compressionMethods + * @param null|array $compressionMethods * @param array $jweHeaderCheckers * @param array $jwsSerializers * @param array $signatureAlgorithms @@ -32,7 +32,7 @@ public function create( array $jweSerializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, - array $compressionMethods, + null|array $compressionMethods, array $jweHeaderCheckers, array $jwsSerializers, array $signatureAlgorithms, diff --git a/src/Library/Signature/Serializer/JWSSerializerManager.php b/src/Library/Signature/Serializer/JWSSerializerManager.php index fdf5b481c..ebdfc70df 100644 --- a/src/Library/Signature/Serializer/JWSSerializerManager.php +++ b/src/Library/Signature/Serializer/JWSSerializerManager.php @@ -17,7 +17,7 @@ class JWSSerializerManager /** * @param JWSSerializer[] $serializers */ - public function __construct(array $serializers) + public function __construct(iterable $serializers) { foreach ($serializers as $serializer) { $this->add($serializer);