Skip to content
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

Add FromRequestGetParameterToAttributesGetRector #1019

Merged
merged 5 commits into from Feb 7, 2019
Merged

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Feb 6, 2019

FromRequestGetParameterToAttributesGetRector

 final class SomeController
 {
     public static function someAction(NetteRequest $request)
     {
-        $value = $request->getParameter('abz');
+        $value = $request->attributes->get('abz');
     }
 }

FromHttpRequestGetHeaderToHeadersGetRector

 final class SomeController
 {
     private $httpRequest;
     public function someAction(Request $request)
     {
-        $header = $this->httpRequest->getHeader('x');
+        $header = $request->headers->get('x');
     }
 }

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Feb 6, 2019

Test fixes are not-related to these 2 new Rectors. They just appeared probably due to updated dependencies

@TomasVotruba TomasVotruba merged commit 128f318 into master Feb 7, 2019
@TomasVotruba
Copy link
Member Author

Mergin so we have this ready today 👍

@TomasVotruba TomasVotruba deleted the nts-request branch February 7, 2019 00:33
@JanMikes
Copy link
Contributor

JanMikes commented Feb 7, 2019

👍

TomasVotruba added a commit that referenced this pull request Oct 18, 2021
rectorphp/rector-src@33e5cab [DowngradePhp80] Handle Throw Exception on DowngradeMatchToSwitchRector (#1019)
TomasVotruba added a commit that referenced this pull request Oct 18, 2021
rectorphp/rector-src@33e5cab [DowngradePhp80] Handle Throw Exception on DowngradeMatchToSwitchRector (#1019)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants