driftingly/rector-laravel

ArgumentAdderRector for nullable arguments should not be added

Closed this issue · 0 comments

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.