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

ArgumentAdderRector for nullable arguments should not be added #110

Closed
gisostallenberg opened this issue Jun 2, 2023 · 0 comments · Fixed by #203
Closed

ArgumentAdderRector for nullable arguments should not be added #110

gisostallenberg opened this issue Jun 2, 2023 · 0 comments · Fixed by #203

Comments

@gisostallenberg
Copy link
Contributor

In `config/sets/laravel60.php:

new ArgumentAdder('Illuminate\Database\Query\Builder', 'from', 1, 'as', null)

The argument 'as' is nullable, which means it is not required.
This rule changes the code as shown:

         DB::query()
-            ->from('table_name')
+            ->from('table_name', null)

which is strange, because the argument is not required, so calling ->from('table_name') is perfectly fine.

    public function from($table, $as = null)
    {

I suggest removing all ArgumentAdder's from laravel60.php for the 'as'-argument, because all four of them are nullable.

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 a pull request may close this issue.

1 participant