Skip to content

Typed property Firehed\JWT\JWT::$keys must not be accessed before initialization #10

@Firehed

Description

@Firehed

Typed property Firehed\JWT\JWT::$keys must not be accessed before initialization in /app/vendor/firehed/jwt/src/JWT.php:49

To reproduce:

$jwt = new JWT(['a' => 'b']);
echo $jwt->getEncoded();

While this goes against the usage of explicitly calling setKeys() per the documentation, IMO it's a flawed API design where you can enter this situation at all. Regrettably, fixing it all the way through ends up being a breaking change somewhere along the way, likely either in the JWT constructor or in the getEncoded method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions