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

PidManagerFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 2
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