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