Total Complexity | 5 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class ManagerThread extends AbstractThread |
||
10 | { |
||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | private $dependencies = []; |
||
15 | |||
16 | public function __construct(string $processName, array $dependencies) |
||
17 | { |
||
18 | $this->dependencies = $dependencies; |
||
19 | parent::__construct($processName); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Return the name of the method to process during the thread |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | protected function getMethodName(): string |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Return the list of dependencies that will be passed as parameters of the method referenced by getMethodName |
||
34 | * |
||
35 | * @return array |
||
36 | */ |
||
37 | protected function getDependencies(): array |
||
38 | { |
||
39 | return $this->dependencies; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param string $processName |
||
44 | * @param ThreadPool $pool |
||
45 | * @return int |
||
46 | */ |
||
47 | public function process(string $processName, ThreadPool $pool) |
||
57 | } |
||
58 | } |