diff --git a/src/Token.php b/src/Token.php index e6da9c90..8423c242 100644 --- a/src/Token.php +++ b/src/Token.php @@ -361,9 +361,7 @@ public function verify( $tokenCacheTtl ??= $this->configuration->getTokenCacheTtl(); $tokenCache ??= $this->configuration->getTokenCache() ?? null; - if (null === $tokenJwksUri) { - $tokenJwksUri = $this->configuration->formatDomain() . '/.well-known/jwks.json'; - } + $tokenJwksUri ??= $this->configuration->formatDomain() . '/.well-known/jwks.json'; $this->getParser()->verify( $tokenAlgorithm, diff --git a/src/Token/Parser.php b/src/Token/Parser.php index d5a0d7fe..52c3dbd8 100644 --- a/src/Token/Parser.php +++ b/src/Token/Parser.php @@ -224,10 +224,7 @@ public function parse( // @codeCoverageIgnoreStart // This is not currently testable using our JWT encoding test libraries. - if (! isset($this->tokenHeaders['typ'])) { - $this->tokenHeaders['typ'] = 'JWT'; - } - + $this->tokenHeaders['typ'] ??= 'JWT'; // @codeCoverageIgnoreEnd } diff --git a/src/Utility/HttpResponsePaginator.php b/src/Utility/HttpResponsePaginator.php index f8373876..84265d78 100644 --- a/src/Utility/HttpResponsePaginator.php +++ b/src/Utility/HttpResponsePaginator.php @@ -328,9 +328,7 @@ private function processLastResponse(): bool throw \Auth0\SDK\Exception\PaginatorException::httpBadResponse(); } - if (null === $start) { - $start = $this->position; - } + $start ??= $this->position; $start = (int) $start; diff --git a/src/Utility/HttpTelemetry.php b/src/Utility/HttpTelemetry.php index 5341c8c0..ca02d0c3 100644 --- a/src/Utility/HttpTelemetry.php +++ b/src/Utility/HttpTelemetry.php @@ -104,9 +104,7 @@ public static function setEnvProperty( string $name, string $version, ): void { - if (null === self::$environment) { - self::$environment = []; - } + self::$environment ??= []; self::$environment[$name] = $version; }