Passed
Pull Request — master (#271)
by Bill
03:10
created

PidManagerFactory::__invoke()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SwooleTW\Http\Server;
4
5
use Psr\Container\ContainerInterface;
6
use Illuminate\Contracts\Config\Repository as ConfigContract;
7
8
class PidManagerFactory
9
{
10
	public function __invoke(ContainerInterface $container): PidManager
11
	{
12
        $config = $container->get('config');
13
14
		return new PidManager(
15
			$config->get('swoole_http.server.options.pid_file') ?: sys_get_temp_dir() . '/swoole.pid'
16
		);
17
	}
18
}
19