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.