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