| Total Complexity | 7 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Cli extends AbstractSystem |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var \BFW\Core\Cli $cli |
||
| 9 | */ |
||
| 10 | protected $cli; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Define the cli property |
||
| 14 | */ |
||
| 15 | public function __construct() |
||
| 16 | { |
||
| 17 | $this->cli = new \BFW\Core\Cli; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | * |
||
| 23 | * @return \BFW\Core\Cli |
||
| 24 | */ |
||
| 25 | public function __invoke() |
||
| 26 | { |
||
| 27 | return $this->cli; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Getter accessor to cli property |
||
| 32 | * |
||
| 33 | * @return \BFW\Core\Cli |
||
| 34 | */ |
||
| 35 | public function getCli() |
||
| 36 | { |
||
| 37 | return $this->cli; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function toRun(): bool |
||
| 44 | { |
||
| 45 | return true; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function run() |
||
| 52 | { |
||
| 53 | $this->runCliFile(); |
||
| 54 | $this->runStatus = true; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Run the cli file if we're in cli mode |
||
| 59 | * |
||
| 60 | * @return void |
||
| 61 | * |
||
| 62 | * @throws \Exception If no file is specified or if the file not exist. |
||
| 63 | */ |
||
| 64 | protected function runCliFile() |
||
| 77 | } |
||
| 78 | } |
||
| 79 |