Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AbstractCustomCommand.php
Go to the documentation of this file.
1<?php
3
5
16abstract class AbstractCustomCommand extends AbstractCmd {
17
22 protected $command;
23
24 public function __construct() {
25 $this->command = new Command($this->getName(), $this->getValue(), $this->getDescription(), $this->getAliases(), $this->getParameters(), $this->getExamples(), $this->getCategory());
26 }
27
33 abstract protected function getName(): string;
34
40 abstract protected function getValue(): string;
41
47 abstract protected function getDescription(): string;
48
53 abstract protected function getAliases(): array;
54
61 abstract protected function getParameters(): array;
62
69 abstract protected function getExamples(): array;
70
76 protected function getCategory() {
77 return 'custom';
78 }
79
85 public function getCommand() {
86 return $this->command;
87 }
88
98 abstract public function run($config, $options, $what, ...$otherArgs);
99}
100
Define a command complete desciption.
Definition Command.php:16
getParameters()
Return the list of parameters.
getDescription()
Return the command description.
run($config, $options, $what,... $otherArgs)
Run this command.
getValue()
Return the command parameter name.