simple-php/app/Console/Commands/TestCommand.php

47 lines
No EOL
854 B
PHP

<?php
namespace App\Console\Commands;
use Cli\Commands\Command;
use Runtime\Contracts\Console\Command as CommandInterface;
class TestCommand extends Command implements CommandInterface
{
/**
* @var string
*/
public $signature = 'test:command';
/**
* @var string
*/
public $description = 'A test command';
/**
* TestCommand constructor.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* @return mixed
*/
public function handle()
{
$name = $this->ask('What is your name? ');
$this->printLn($this->argument('test'));
$this->success('Succcess: Hello ' . $name);
$this->warning('Warning: Hello ' . $name);
$this->error('Error: Hello ' . $name);
return true;
}
}