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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners