public function getAll() : array
    {
        $convertedClaims = [];
        $timeFields = ['exp', 'nbf', 'iat'];

        // Convert date times to timestamps
        foreach ($this->claims as $name => $value) {
            if ($value !== null && in_array($name, $timeFields)) {
                /** @var DateTimeImmutable $value */
                $value = $value->getTimestamp();
            }

            $convertedClaims[$name] = $value;
        }

        if (!isset($this->claims['jti'])) {
            $convertedClaims['jti'] = $this->getId();
        }

        return $convertedClaims;
    }