rector-laravel icon indicating copy to clipboard operation
rector-laravel copied to clipboard

Rector upgrades rules for Laravel

Results 14 rector-laravel issues
Sort by recently updated
recently updated
newest added

Since Laravel tends to depend on lots of behind the scene magic, using static on calls to functions and closures tends not give what you want. Rector should not introduce...

Still a work in progress but would love some early feedback. # Changes * deprecates two older rules for the new type declaration sets. * sets up a dir for...

enhancement

Hi, How can I prevent that Facades are being rewritten to Service classes? ``` - $subtotal = Webshop::calculateTotals($order->cart, $order->country, coupon: $coupon); + $subtotal = (new Webshop())->calculateTotals($order->cart, $order->country, coupon: $coupon); ```...

It will not be able to resolve the classname properly and fails when $phpMethodReflection is null. ```php Route::group(['namespace' => 'MyApp\Controllers'], function(): void { Route::get('api/foo', 'SomeController@method'); }); ```

First of all, this project looks fantastic. I used this rule on a codebase and it covered 90% of my needs. However, this is just a proposal but could there...

In `config/sets/laravel60.php: ```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: ```diff DB::query()...

This ensures a leading slash `\` is added to the namespace of the class that is newed up, ensuring the namespace is loaded from the root and not relative to...

# Changes This adds the interface types to the config # Why Without these it's likely the set will miss a number of the instances where the rule could be...

enhancement

# Why 'hash' points to the incorrect implementation and should point to `Illuminate\Hashing\HashManager` instead of the Hasher contract.

bug

Using the rule `DispatchNonShouldQueueToDispatchSyncRector` it should detect the `ShouldQueue` interface on a class even when it is imported as alias. This PR adds a failing test for this case.