New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v5.5.0 JWT::decode() signature breaks backward compatibility #369
Comments
Changing method signature is a BC break. Maybe this should be released as 6.0? |
Yes, got it today in composer update, the main package what used it even didn't know about it. That's was really frustrating |
IMPORTANT: 5.5 does not break backwards compatibility, only the docblock was changedThe resource type still accepts Do you have an example of a previous implementation actually breaking, or are you only concerned regarding the documentation of the function? The intention of |
We can change the docblock to include |
With this package - https://github.com/patrickbussmann/oauth2-apple - and 5.5.0 it makes "Uncaught PHP Exception UnexpectedValueException: "$keyOrKeyArray must be a string key, an array of string keys, an instance of Firebase\JWT\Key key or an array of Firebase\JWT\Key keys" |
Ok you're right... The exception here will be thrown when keys are a resource, which was previously accepted. I'll remove it and add a test and tag 5.5.1 |
Okay so it is backward compatible, good news. The only issues we met are the errors reported by static analysis (PHPStan) which reads the typehints and the PHPDoc. Thank you for your response. |
It's not a runtime BC, but it does break pipelines that have tools like PHPStan running, as they will complain that passing a string is not allowed. Also, since PHP now has named parameters, that makes parameters names part of the public API as well. So changing the name of a parameter is also a BC break. |
While you're at it, you might also want to fix this PHPDoc:
(JWT::getKeyMaterialAndAlgorithm; parsed type is "an") |
@bshaffer Yes this would work for me ! |
The variable is still renamed, so technically it's still a BC. Personally I don't mind. Just saying. |
The Firebase\JWT::decode() method signature changed for its second argument from
string|array|resource
toKey|array<Key>
, which broke some of our CI builds at their static analysis stage. This has been introduced in v5.5.0 with bc0df64. We're going to lock our version dependency at>=5.0 <5.5
but would like to know if this will be reverted or not ?The text was updated successfully, but these errors were encountered: