mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
JwtUtils: fix phpstan failure
This commit is contained in:
parent
0b6d6306cf
commit
a6c35cab9a
@ -36,12 +36,7 @@ final class JwtUtils{
|
|||||||
if(count($v) !== 3){
|
if(count($v) !== 3){
|
||||||
throw new \UnexpectedValueException("Expected exactly 3 JWT parts, got " . count($v));
|
throw new \UnexpectedValueException("Expected exactly 3 JWT parts, got " . count($v));
|
||||||
}
|
}
|
||||||
$payloadB64 = $v[1];
|
$result = json_decode(self::b64UrlDecode($v[1]), true);
|
||||||
$payloadJSON = self::b64UrlDecode($payloadB64);
|
|
||||||
if($payloadJSON === false){
|
|
||||||
throw new \UnexpectedValueException("Invalid base64 JWT payload");
|
|
||||||
}
|
|
||||||
$result = json_decode($payloadJSON, true);
|
|
||||||
if(!is_array($result)){
|
if(!is_array($result)){
|
||||||
throw new \UnexpectedValueException("Failed to decode JWT payload JSON: " . json_last_error_msg());
|
throw new \UnexpectedValueException("Failed to decode JWT payload JSON: " . json_last_error_msg());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user