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