Adds a new rule to refactor commands and make use of the component property that handles using Termwind output like most of the Laravel commands have used.
use Illuminate\Console\Command;
class CommandWithComponents extends Command
{
public function handle()
{
- $this->ask('What is your name?');
- $this->line('A line!');
- $this->info('Info!');
- $this->error('Error!');
+ $this->components->ask('What is your name?');
+ $this->components->line('A line!');
+ $this->components->info('Info!');
+ $this->components->error('Error!');
}
}
Will only affect inheriting from Console commands and will only do the specific methods.
Adds a new rule to refactor commands and make use of the component property that handles using Termwind output like most of the Laravel commands have used.
UseComponentPropertyWithinCommandsRector
Use
$this->components
property within commandsRectorLaravel\Rector\MethodCall\UseComponentPropertyWithinCommandsRector
Will only affect inheriting from Console commands and will only do the specific methods.