From c82769a1a66aedea50a1ae5ae08ca58c1da92995 Mon Sep 17 00:00:00 2001 From: Daniel Burger <48986191+danielburger1337@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:13:11 +0100 Subject: [PATCH] Apply php-cs-fixer --- src/DPoPProofFactory.php | 2 +- src/DPoPProofVerifier.php | 4 ++-- src/Exception/DPoPReplayAttackException.php | 2 +- src/Exception/InvalidDPoPNonceException.php | 2 +- src/Loader/WebTokenFrameworkDPoPTokenLoader.php | 2 +- src/Model/AccessTokenModel.php | 2 +- src/Model/DPoPProof.php | 2 +- src/Model/DecodedDPoPProof.php | 2 +- src/Model/WebTokenFrameworkJwk.php | 2 +- src/NonceFactory/CacheNonceFactory.php | 2 +- src/NonceFactory/WebTokenFrameworkNonceFactory.php | 2 +- src/NonceStorage/CacheNonceStorage.php | 2 +- tests/UtilTest.php | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/DPoPProofFactory.php b/src/DPoPProofFactory.php index 58ca735..9f4f20a 100644 --- a/src/DPoPProofFactory.php +++ b/src/DPoPProofFactory.php @@ -30,7 +30,7 @@ public function __construct( private readonly DPoPTokenEncoderInterface $encoder, private readonly NonceStorageInterface $nonceStorage, private readonly NonceStorageKeyFactoryInterface $nonceStorageKeyFactory = new NonceStorageKeyFactory(), - private readonly int $jtiByteLength = 32 + private readonly int $jtiByteLength = 32, ) { } diff --git a/src/DPoPProofVerifier.php b/src/DPoPProofVerifier.php index e4f1316..b53df6e 100644 --- a/src/DPoPProofVerifier.php +++ b/src/DPoPProofVerifier.php @@ -35,7 +35,7 @@ public function __construct( private readonly ?NonceFactoryInterface $nonceFactory = null, private readonly ?ReplayAttackDetectorInterface $replayAttackDetector = null, private readonly int $allowedTimeDrift = 5, - private readonly int $allowedMaxAge = 30 + private readonly int $allowedMaxAge = 30, ) { } @@ -62,7 +62,7 @@ public function verifyFromRequest(ServerRequestInterface|Request $request, Acces match (\count($headers)) { 0 => throw new MissingDPoPProofException('The request did not contain a "DPoP" header.'), 1 => null, - default => throw new InvalidDPoPProofException('The request must contain exactly one "DPoP" header.') + default => throw new InvalidDPoPProofException('The request must contain exactly one "DPoP" header.'), }; return $this->verifyFromRequestParts($headers[\array_key_first($headers)], $request->getMethod(), $request->getUri(), $boundTo); diff --git a/src/Exception/DPoPReplayAttackException.php b/src/Exception/DPoPReplayAttackException.php index bc21d15..c54a2cc 100644 --- a/src/Exception/DPoPReplayAttackException.php +++ b/src/Exception/DPoPReplayAttackException.php @@ -13,7 +13,7 @@ public function __construct( public readonly DecodedDPoPProof $proof, string $message = 'The given DPoP proof was already presented.', int $code = 0, - ?\Throwable $previous = null + ?\Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/src/Exception/InvalidDPoPNonceException.php b/src/Exception/InvalidDPoPNonceException.php index 3592a1b..3620bbd 100644 --- a/src/Exception/InvalidDPoPNonceException.php +++ b/src/Exception/InvalidDPoPNonceException.php @@ -12,7 +12,7 @@ public function __construct( public readonly string $newNonce, string $message = '', int $code = 0, - ?\Throwable $previous = null + ?\Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/src/Loader/WebTokenFrameworkDPoPTokenLoader.php b/src/Loader/WebTokenFrameworkDPoPTokenLoader.php index def63aa..2f8b39d 100644 --- a/src/Loader/WebTokenFrameworkDPoPTokenLoader.php +++ b/src/Loader/WebTokenFrameworkDPoPTokenLoader.php @@ -26,7 +26,7 @@ class WebTokenFrameworkDPoPTokenLoader implements DPoPTokenLoaderInterface * @param AlgorithmManager $algorithmManager An algorithm manager that contains all the JWA algorithms that are supported. */ public function __construct( - private readonly AlgorithmManager $algorithmManager + private readonly AlgorithmManager $algorithmManager, ) { $this->serializer = new JWSSerializerManager([new CompactSerializer()]); } diff --git a/src/Model/AccessTokenModel.php b/src/Model/AccessTokenModel.php index bf47296..452fb5a 100644 --- a/src/Model/AccessTokenModel.php +++ b/src/Model/AccessTokenModel.php @@ -12,7 +12,7 @@ final class AccessTokenModel */ public function __construct( public readonly \Stringable|string $accessToken, - public readonly string $jkt + public readonly string $jkt, ) { } } diff --git a/src/Model/DPoPProof.php b/src/Model/DPoPProof.php index b7ba9b3..4f5005c 100644 --- a/src/Model/DPoPProof.php +++ b/src/Model/DPoPProof.php @@ -10,7 +10,7 @@ final class DPoPProof implements \Stringable */ public function __construct( public readonly JwkInterface $jwk, - public readonly string $proof + public readonly string $proof, ) { } diff --git a/src/Model/DecodedDPoPProof.php b/src/Model/DecodedDPoPProof.php index ba76286..69af4af 100644 --- a/src/Model/DecodedDPoPProof.php +++ b/src/Model/DecodedDPoPProof.php @@ -14,7 +14,7 @@ final class DecodedDPoPProof public function __construct( public readonly JwkInterface $jwk, public readonly array $payload, - public readonly array $protectedHeader + public readonly array $protectedHeader, ) { } } diff --git a/src/Model/WebTokenFrameworkJwk.php b/src/Model/WebTokenFrameworkJwk.php index b3be746..503136e 100644 --- a/src/Model/WebTokenFrameworkJwk.php +++ b/src/Model/WebTokenFrameworkJwk.php @@ -13,7 +13,7 @@ final class WebTokenFrameworkJwk implements JwkInterface public function __construct( public readonly JWK $jwk, public readonly string $jkt, - public readonly Algorithm $algorithm + public readonly Algorithm $algorithm, ) { } diff --git a/src/NonceFactory/CacheNonceFactory.php b/src/NonceFactory/CacheNonceFactory.php index 325eb46..34cfa2d 100644 --- a/src/NonceFactory/CacheNonceFactory.php +++ b/src/NonceFactory/CacheNonceFactory.php @@ -9,7 +9,7 @@ class CacheNonceFactory implements NonceFactoryInterface { public function __construct( private readonly CacheItemPoolInterface $cache, - private readonly \DateInterval $ttl = new \DateInterval('PT15M') + private readonly \DateInterval $ttl = new \DateInterval('PT15M'), ) { } diff --git a/src/NonceFactory/WebTokenFrameworkNonceFactory.php b/src/NonceFactory/WebTokenFrameworkNonceFactory.php index d0b3e5f..3884206 100644 --- a/src/NonceFactory/WebTokenFrameworkNonceFactory.php +++ b/src/NonceFactory/WebTokenFrameworkNonceFactory.php @@ -43,7 +43,7 @@ public function __construct( private readonly ClockInterface $clock, private readonly \DateInterval $ttl = new \DateInterval('PT15M'), private readonly int $allowedTimeDrift = 5, - private readonly ?\Closure $closure = null + private readonly ?\Closure $closure = null, ) { if ($algorithm instanceof Algorithm) { $algorithm = new AlgorithmManager([$algorithm]); diff --git a/src/NonceStorage/CacheNonceStorage.php b/src/NonceStorage/CacheNonceStorage.php index afb2e18..5500d7c 100644 --- a/src/NonceStorage/CacheNonceStorage.php +++ b/src/NonceStorage/CacheNonceStorage.php @@ -14,7 +14,7 @@ class CacheNonceStorage implements NonceStorageInterface */ public function __construct( private readonly CacheItemPoolInterface $cache, - private readonly \DateInterval $ttl = new \DateInterval('PT5M') + private readonly \DateInterval $ttl = new \DateInterval('PT5M'), ) { } diff --git a/tests/UtilTest.php b/tests/UtilTest.php index 52337f9..728d5ce 100644 --- a/tests/UtilTest.php +++ b/tests/UtilTest.php @@ -103,7 +103,7 @@ private function createStringableAccessToken(): \Stringable { return new class(self::ACCESS_TOKEN) implements \Stringable { public function __construct( - private readonly string $accessToken + private readonly string $accessToken, ) { }