-
Notifications
You must be signed in to change notification settings - Fork 155
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
Upgrade rest bundle #167
Upgrade rest bundle #167
Conversation
loic425
commented
Jun 4, 2020
•
edited
Loading
edited
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | not anymore |
Deprecations? | no |
Related tickets | |
License | MIT |
@pamil we have a lot of work here 🤣 |
@lchrusciel @pamil |
src/Bundle/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php
Outdated
Show resolved
Hide resolved
…Handler.php Co-authored-by: Kamil Kokot <kamil@kokot.me>
@pamil To copy here what we said in slack. We can create a recipe for this bundle with this configuration:
|
src/Bundle/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Kamil Kokot <kamil@kokot.me>
Co-authored-by: Kamil Kokot <kamil@kokot.me>
…Handler.php Co-authored-by: Kamil Kokot <kamil@kokot.me>
32279f1
to
2b0c45f
Compare
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.
looks good to me
@@ -58,7 +58,8 @@ public function get(RequestConfiguration $requestConfiguration, RepositoryInterf | |||
$requestConfiguration->getPaginationMaxPerPage(), | |||
$paginationLimits | |||
)); | |||
$paginator->setCurrentPage($request->query->get('page', 1)); | |||
$currentPage = (int) $request->query->get('page', '1'); |
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.
Woulndn't it be better?
$currentPage = (int) $request->query->get('page', '1'); | |
$currentPage = (int) $request->query->getInt('page', '1'); |
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.
@lchrusciel Yes, but, if it returns an integer, we don't need the (int) conversion after :)
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.
I pushed another suggestion to remove the unnecessary int conversion in your suggestion.
@@ -58,7 +58,8 @@ public function get(RequestConfiguration $requestConfiguration, RepositoryInterf | |||
$requestConfiguration->getPaginationMaxPerPage(), | |||
$paginationLimits | |||
)); | |||
$paginator->setCurrentPage($request->query->get('page', 1)); | |||
$currentPage = (int) $request->query->get('page', '1'); |
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.
$currentPage = (int) $request->query->get('page', '1'); | |
$currentPage = $request->query->getInt('page', '1'); |
Thank you, Loïc! 🎉 |