Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 1 | public function __invoke(ContainerInterface $container): Socket |
|
14 | { |
||
15 | /** @var LoopInterface $loop */ |
||
16 | 1 | $loop = $container->get(LoopInterface::class); |
|
17 | /** @var array<string, array> $globalConfig */ |
||
18 | 1 | $globalConfig = $container->get('config'); |
|
19 | /** @var array<string, string|null> $config */ |
||
20 | 1 | $config = $globalConfig['server']; |
|
21 | |||
22 | 1 | return new Socket(sprintf( |
|
23 | 1 | '%s:%s', |
|
24 | 1 | $config['host'] ?? '0.0.0.0', |
|
25 | 1 | $config['port'] ?? '8080' |
|
26 | ), $loop); |
||
27 | } |
||
29 |