Skip to content
Prev Previous commit
Next Next commit
Update JWT.php
  • Loading branch information
bshaffer authored Nov 24, 2024
commit e1f64ee8042c6a15dcd5895764a1f00da85f667c
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 @@
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
Loading