~fkooman/php-jwt

1fa4e4a4fcfbaeff246fec48951ea2889fee2757 — François Kooman 3 years ago d5f1776
small cleanups
1 files changed, 4 insertions(+), 8 deletions(-)

M src/Jwt.php
M src/Jwt.php => src/Jwt.php +4 -8
@@ 154,19 154,17 @@ abstract class Jwt
     * Make sure we have an "alg" with the correct value and that "crit" is
     * not set.
     *
     * @param array<mixed> $headerData
     *
     * @return void
     */
    private function checkHeader(array $headerData)
    private function checkHeader(array $jwtHeaderData)
    {
        if (!\array_key_exists('alg', $headerData)) {
        if (!\array_key_exists('alg', $jwtHeaderData)) {
            throw new JwtException('"alg" header key missing');
        }
        if ($this->getAlgorithm() !== $headerData['alg']) {
        if ($this->getAlgorithm() !== $jwtHeaderData['alg']) {
            throw new JwtException('unexpected "alg" value');
        }
        if (\array_key_exists('crit', $headerData)) {
        if (\array_key_exists('crit', $jwtHeaderData)) {
            throw new JwtException('"crit" header key not supported');
        }
    }


@@ 174,8 172,6 @@ abstract class Jwt
    /**
     * Verify the "exp" and "nbf" keys iff they are set.
     *
     * @param array<mixed> $payloadData
     *
     * @return void
     */
    private function checkToken(array $payloadData)