Skip to content

Commit

Permalink
Apply cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
danielburger1337 committed Mar 4, 2024
1 parent de10621 commit a3ecd5d
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "danielburger1337/oauth2-dpop",
"type": "library",
"description": "Create/Verify OAuth DPoP tokens.",
"description": "Create/Verify OAuth2 DPoP tokens.",
"license": "MIT",
"homepage": "https://github.com/danielburger1337/oauth2-dpop-php",
"authors": [
Expand All @@ -20,17 +20,17 @@
"spomky-labs/base64url": "^2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.50.0",
"nyholm/psr7": "^1.8",
"paragonie/constant_time_encoding": "^2.6",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.0",
"friendsofphp/php-cs-fixer": "^3.51.0",
"nyholm/psr7": "^1.8.1",
"paragonie/constant_time_encoding": "^2.6.3",
"phpstan/phpstan": "^1.10.59",
"phpunit/phpunit": "^11.0.4",
"psr/cache": "^3.0",
"psr/http-message": "^2.0",
"spomky-labs/otphp": "^11.2",
"symfony/clock": "^7.0",
"symfony/http-foundation": "^7.0",
"web-token/jwt-library": "^3.3"
"symfony/clock": "^7.0.3",
"symfony/http-foundation": "^7.0.4",
"web-token/jwt-library": "^3.3.1"
},
"config": {
"sort-packages": true
Expand Down
2 changes: 1 addition & 1 deletion src/Encoder/DPoPTokenEncoderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface DPoPTokenEncoderInterface
*
* @throws MissingDPoPJwkException If no JWK that matches the given constraints was found.
*/
public function selectJWK(array $serverSupportedSignatureAlgorithms, string|null $jkt = null): JwkInterface;
public function selectJWK(array $serverSupportedSignatureAlgorithms, ?string $jkt = null): JwkInterface;

/**
* Encode a DPoP proof.
Expand Down
2 changes: 1 addition & 1 deletion src/Encoder/WebTokenFrameworkDPoPTokenEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(
$this->serializer = new JWSSerializerManager([new CompactSerializer()]);
}

public function selectJWK(array $serverSupportedSignatureAlgorithms, string|null $jkt = null): JwkInterface
public function selectJWK(array $serverSupportedSignatureAlgorithms, ?string $jkt = null): JwkInterface
{
foreach ($serverSupportedSignatureAlgorithms as $algorithmName) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/DPoPReplayAttackException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct(
public readonly DecodedDPoPProof $proof,
string $message = 'The given DPoP proof was already presented.',
int $code = 0,
\Throwable|null $previous = null
?\Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidDPoPNonceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(
public readonly string $newNonce,
string $message = '',
int $code = 0,
\Throwable|null $previous = null
?\Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/NonceFactory/CacheNonceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function createNewNonce(string $thumbprint): string
return $nonce;
}

public function createNewNonceIfInvalid(string $thumbprint, string $nonce): string|null
public function createNewNonceIfInvalid(string $thumbprint, string $nonce): ?string
{
try {
$item = $this->cache->getItem($nonce);
Expand Down
2 changes: 1 addition & 1 deletion src/NonceFactory/NonceFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ public function createNewNonce(string $thumbprint): string;
*
* @return string|null The nonce or `null` if the provided nonce is valid.
*/
public function createNewNonceIfInvalid(string $thumbprint, string $nonce): string|null;
public function createNewNonceIfInvalid(string $thumbprint, string $nonce): ?string;
}
2 changes: 1 addition & 1 deletion src/NonceFactory/WebTokenFrameworkNonceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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|null $closure = null
private readonly ?\Closure $closure = null
) {
if ($algorithm instanceof Algorithm) {
$algorithm = new AlgorithmManager([$algorithm]);
Expand Down
2 changes: 1 addition & 1 deletion src/NonceStorage/NonceStorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface NonceStorageInterface
*
* @return string|null The current nonce or `null` if none exists.
*/
public function getCurrentNonce(string $key): string|null;
public function getCurrentNonce(string $key): ?string;

/**
* Store a new DPoP-Nonce from an upstream server.
Expand Down
2 changes: 1 addition & 1 deletion tests/NonceFactory/WebTokenFrameworkNonceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function createNewNonce_noneAlgorithm_throwsException(): void
$nonceFactory->createNewNonce(self::JKT);
}

private function assertIsValidNonce(string|null $nonce): void
private function assertIsValidNonce(?string $nonce): void
{
$this->assertIsString($nonce);
$this->assertNull($this->nonceFactory->createNewNonceIfInvalid(self::JKT, $nonce));
Expand Down
2 changes: 1 addition & 1 deletion tests/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class UtilTest extends TestCase
*/
#[Test]
#[DataProvider('parseSupportedAlgorithmsFromHeaderDataProvider')]
public function parseSupportedAlgorithmsFromHeader_returnsExpected(string $header, array|null $expected): void
public function parseSupportedAlgorithmsFromHeader_returnsExpected(string $header, ?array $expected): void
{
$returnValue = Util::parseSupportedAlgorithmsFromHeader($header);
$this->assertEquals($expected, $returnValue);
Expand Down

0 comments on commit a3ecd5d

Please sign in to comment.