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

Improve request input refactor #283

Merged
merged 5 commits into from
Dec 23, 2024
Merged

Conversation

peterfox
Copy link
Collaborator

@peterfox peterfox commented Dec 22, 2024

Changes

  • Improves some of the scenarios with the RequestVariablesToRequestFacadeRector rule. Namely it handles the split between get, post and request into the right method calls. Also handles replacing the whole variable.
  • Adds tests for the scenario
  • Docs update

Why

It makes this rule far more useful as a better 1:1 conversion of PHP to Laravel method calls on the Request facade.

-$_GET['value'];
-$_POST['value'];
-$_REQUEST['value'];
-$_POST;
-$_GET;
-$_REQUEST;
+\Illuminate\Support\Facades\Request::query('value');
+\Illuminate\Support\Facades\Request::post('value');
+\Illuminate\Support\Facades\Request::input('value');
+\Illuminate\Support\Facades\Request::query();
+\Illuminate\Support\Facades\Request::post();
+\Illuminate\Support\Facades\Request::all();

@peterfox peterfox added the enhancement New feature or request label Dec 22, 2024
@peterfox peterfox self-assigned this Dec 22, 2024
@GeniJaho GeniJaho merged commit d4fff7a into main Dec 23, 2024
5 checks passed
@GeniJaho GeniJaho deleted the feature/improve-request-input-refactor branch December 23, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants