Acacha\Llum\Console\ConsoleCommand::description PHP Method

description() public method

Set/get description.
public description ( null | string $description = null ) : ConsoleCommand | string
$description null | string
return ConsoleCommand | string | string
    public function description($description = null)
    {
        return $this->getterSetter('description', $description);
    }

Usage Example

Example #1
0
 /**
  * Configure the command options.
  *
  * @param ConsoleCommand $command
  *
  * @throws \Acacha\Llum\Exceptions\InvalidCommandException
  */
 protected function configureCommand(ConsoleCommand $command)
 {
     $this->ignoreValidationErrors();
     $name = $command->name();
     $description = $command->description();
     if (!is_string($name) || !is_string($description)) {
         throw new InvalidCommandException();
     }
     $this->setName($name)->setDescription($description);
     if ($command->argument() != null) {
         $this->addArgument($command->argument()['name'], $command->argument()['type'], $command->argument()['description']);
     }
 }