-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Simplify UriSigner when working with HttpFoundation's Request #35284
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
Simplify UriSigner when working with HttpFoundation's Request #35284
Conversation
Failing tests look unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with two minor comments
@@ -39,7 +41,7 @@ public function __construct(string $secret, string $parameter = '_hash') | |||
* | |||
* @return string The signed URI | |||
*/ | |||
public function sign(string $uri) | |||
public function sign(string $uri): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be reverted
@@ -59,7 +61,7 @@ public function sign(string $uri) | |||
* | |||
* @return bool True if the URI is signed correctly, false otherwise | |||
*/ | |||
public function check(string $uri) | |||
public function check(string $uri): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be reverted
Done. Thought they were missing accidentally during the upgrade to 5.0. |
7363ceb
to
4887b4b
Compare
Thank you @Toflar. |
I'm using the
UriSigner
in my own projects from time to time and I've always wondered why I have to manually generate the URI from theRequest
instance in such a way that it is correctly validated.Let's add a new
checkRequest(Request $request)
method to provide better DX.