phpstan fixes

This commit is contained in:
2023-04-09 14:10:12 +02:00
parent b9c690cb6e
commit 822b796d40
3 changed files with 26 additions and 10 deletions

View File

@ -10,8 +10,8 @@ use NoccyLabs\SimpleJWT\Key\KeyInterface;
*
*
*
* @property-read header PropertyBag
* @property-read claim PropertyBag
* @property-read PropertyBag $header
* @property-read PropertyBag $claims
*/
class JWTToken
{
@ -30,7 +30,8 @@ class JWTToken
* Constructor
*
*
* @param KeyInterface The key used to sign the token
* @param KeyInterface $key The key used to sign the token
* @param string|null $token Token data
*/
public function __construct(KeyInterface $key, ?string $token=null)
{
@ -127,6 +128,8 @@ class JWTToken
case 'm':
$fact = 60;
break;
default:
throw new \InvalidArgumentException();
}
$this->header->set('exp', time() + (intval($match[1]) * $fact));
} else {