| Conditions | 3 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 44 | 1 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 45 | { |
||
| 46 | 1 | $logger = $this->getConsoleLogger($output); |
|
| 47 | |||
| 48 | 1 | $file = $input->getArgument('config-file'); |
|
| 49 | |||
| 50 | // Test if config file exists |
||
| 51 | 1 | if (!file_exists($file) || !is_readable($file)) { |
|
| 52 | $msg = "Configuration file '$file' does not exists or is not readable'"; |
||
| 53 | throw new \InvalidArgumentException($msg); |
||
| 54 | } |
||
| 55 | |||
| 56 | 1 | $params = include($file); |
|
| 57 | |||
| 58 | 1 | $config = new StandaloneServer\Config($params); |
|
| 59 | 1 | $this->logServerConfig($logger, $config); |
|
| 60 | 1 | $this->server = new StandaloneServer($config, $logger); |
|
| 61 | |||
| 62 | 1 | $output->writeln($this->server->getCommand()); |
|
| 63 | |||
| 64 | 1 | return 1; |
|
| 65 | } |
||
| 66 | } |
||
| 67 |