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