| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 41 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 42 | { |
||
| 43 | $file = $input->getArgument('config-file'); |
||
| 44 | |||
| 45 | // Test if config file exists |
||
| 46 | if (!file_exists($file) || !is_readable($file)) { |
||
| 47 | $msg = "Configuration file '$file' does not exists or is not readable'"; |
||
| 48 | throw new \InvalidArgumentException($msg); |
||
| 49 | } |
||
| 50 | $params = include($file); |
||
| 51 | $port = $params['port']; |
||
| 52 | $config = new StandaloneServer\Config($params); |
||
| 53 | |||
| 54 | $this->server = new StandaloneServer($config); |
||
| 55 | $this->server->restart(); |
||
| 56 | |||
| 57 | $output->write("Server successfully restarted on port $port" . PHP_EOL); |
||
| 58 | } |
||
| 59 | } |
||
| 60 |