| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | abstract class AbstractCommand extends Command |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Configues the command. By default, uses the class name to derive the |
||
| 13 | * command name. |
||
| 14 | */ |
||
| 15 | 2 | protected function configure() |
|
| 16 | { |
||
| 17 | 2 | preg_match('/(\w+)Command/', get_class($this), $matches); |
|
| 18 | 2 | if (isset($matches[1])) { |
|
| 19 | 2 | $name = Inflector::get()->hyphenate($matches[1]); |
|
| 20 | 2 | $this->setName($name); |
|
| 21 | } |
||
| 22 | 2 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Outputs the desired failure message. |
||
| 26 | * |
||
| 27 | * @param OutputInterface $output The output instance. |
||
| 28 | * @param string $message The failure message. |
||
| 29 | */ |
||
| 30 | 1 | final protected function fail(OutputInterface $output, string $message) |
|
| 36 | 1 | } |
|
| 37 | } |
||
| 38 |