Version(s) affected
4.1.7
Description
|
* @param array{alg?: string, string?: mixed} $jweSharedProtectedHeader |
This defines the type of $jweSharedProtectedHeader and $jweSharedHeader as accepting 2 optional keys (alg and string. The documented usage passes an enc key
How to reproduce
Take the code snippet from https://web-token.spomky-labs.com/advanced-topics/nested-tokens#nested-token-building and analyze it with phpstan with bleeding-edge enabled (sealed array shapes are not yet used in normal mode for BC reasons) or with psalm.
Possible Solution
Define the proper array shape for the parameter (I tried to figure the right type myself, but the NestedTokenBuilder passes the value to the JWE layer that does not define the array type)
Additional Context
No response
Version(s) affected
4.1.7
Description
jwt-framework/src/Library/NestedToken/NestedTokenBuilder.php
Line 28 in 98184b5
This defines the type of
$jweSharedProtectedHeaderand$jweSharedHeaderas accepting 2 optional keys (algandstring. The documented usage passes anenckeyHow to reproduce
Take the code snippet from https://web-token.spomky-labs.com/advanced-topics/nested-tokens#nested-token-building and analyze it with phpstan with bleeding-edge enabled (sealed array shapes are not yet used in normal mode for BC reasons) or with psalm.
Possible Solution
Define the proper array shape for the parameter (I tried to figure the right type myself, but the NestedTokenBuilder passes the value to the JWE layer that does not define the array type)
Additional Context
No response