Skip to content

Commit

Permalink
Update JWT.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Nov 24, 2024
1 parent 90b2f60 commit e1f64ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public static function sign(
return \hash_hmac($algorithm, $msg, $key, true);
case 'openssl':
$signature = '';
if (\is_resource($key) && !openssl_pkey_get_private($key)) {
if (!\is_resource($key) && !openssl_pkey_get_private($key)) {

Check failure on line 254 in src/JWT.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Parameter #1 $private_key of function openssl_pkey_get_private expects array|OpenSSLAsymmetricKey|OpenSSLCertificate|string, OpenSSLAsymmetricKey|OpenSSLCertificate|resource|string given.
throw new DomainException('OpenSSL unable to validate key');
}
$success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line
Expand Down

0 comments on commit e1f64ee

Please sign in to comment.