I recently discovered Rector and was completely blown away by its power and effectiveness. The promise is simple: you install and run the package, you get instant automated upgrades and refactorings.

#auto-import-class-names Auto import class names /** - * - * @return \Illuminate\Broadcasting\Channel|array - */ + * + * @return Channel|array + */ public function broadcastOn()

#changing-the-string-class-name-to-a-class-constant Changing the string class name to a class constant public function user() { - return $this->belongsTo('App\User'); + return $this->belongsTo(User::class); }

#inline-useless-variables Inline useless variables - $phone = str_replace(' ', '', $phone); - return $phone; + return str_replace(' ', '', $phone); This is another low-hanging fruit.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners