1 | <?php declare(strict_types=1); |
||
21 | class Pool implements PoolUtilizerInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var LoopInterface |
||
25 | */ |
||
26 | protected $loop; |
||
27 | |||
28 | /** |
||
29 | * @var PoolInfoInterface |
||
30 | */ |
||
31 | protected $pool; |
||
32 | |||
33 | /** |
||
34 | * @var Pool |
||
35 | */ |
||
36 | protected static $instance = null; |
||
37 | |||
38 | /** |
||
39 | * @var bool |
||
40 | */ |
||
41 | protected static $reset = false; |
||
42 | |||
43 | /** |
||
44 | * @param LoopInterface $loop |
||
45 | * @param array $config |
||
46 | */ |
||
47 | protected function __construct(LoopInterface $loop, array $config = []) |
||
59 | 4 | ||
60 | 4 | /** |
|
61 | 4 | * @param LoopInterface|null $loop |
|
62 | * @param array $config |
||
63 | * @throws \Exception |
||
64 | * @return Pool |
||
65 | */ |
||
66 | public static function getInstance(LoopInterface $loop = null, array $config = []) |
||
78 | |||
79 | public static function reset() |
||
83 | |||
84 | /** |
||
85 | * @param $className |
||
86 | 4 | * @param $tableName |
|
87 | * @param $function |
||
88 | 4 | * @param array $arguments |
|
89 | 4 | * @return PromiseInterface |
|
90 | */ |
||
91 | public function call($className, $tableName, $function, array $arguments) |
||
99 | 25 | ||
100 | public function paginate($tableName, $params, $settings) |
||
110 | |||
111 | /** |
||
112 | * @inheritDoc |
||
113 | */ |
||
114 | public function info() |
||
122 | |||
123 | /** |
||
124 | * @return LoopInterface |
||
125 | */ |
||
126 | public function getLoop() |
||
130 | |||
131 | /** |
||
132 | * @return PoolInfoInterface |
||
133 | */ |
||
134 | public function getPool() |
||
138 | |||
139 | /** |
||
140 | * @param array $config |
||
141 | * @return array |
||
142 | */ |
||
143 | protected function applyConfig(array $config) |
||
155 | |||
156 | /** |
||
157 | * @param $className |
||
158 | * @param $tableName |
||
159 | * @param $function |
||
160 | * @param array $arguments |
||
161 | * @return PromiseInterface |
||
162 | */ |
||
163 | protected function poolCall($className, $tableName, $function, array $arguments) |
||
174 | |||
175 | /** |
||
176 | * @param $tableName |
||
177 | 1 | * @param $function |
|
178 | * @param array $arguments |
||
179 | 1 | * @return PromiseInterface |
|
180 | */ |
||
181 | protected function waitForPoolCall($tableName, $function, array $arguments) |
||
197 | } |
||
198 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.