1 | <?php |
||
15 | class Process implements ProcessInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array|InterceptorInterface[] |
||
19 | */ |
||
20 | private $interceptors = []; |
||
21 | |||
22 | /** |
||
23 | * @var array|callable[] |
||
24 | */ |
||
25 | private $ticks = []; |
||
26 | |||
27 | /** |
||
28 | * @var \SplQueue|DeferredInterface[] |
||
29 | */ |
||
30 | private $deferred; |
||
31 | |||
32 | /** |
||
33 | * Process constructor. |
||
34 | */ |
||
35 | public function __construct() |
||
39 | |||
40 | /** |
||
41 | * @param mixed $process |
||
42 | * @return mixed |
||
43 | */ |
||
44 | public function await($process) |
||
48 | |||
49 | /** |
||
50 | * @param mixed $process |
||
51 | * @return mixed |
||
52 | */ |
||
53 | private function exec($process) |
||
57 | |||
58 | /** |
||
59 | * @param callable $callable |
||
60 | * @return DeferredInterface |
||
61 | */ |
||
62 | public function deferred(callable $callable): DeferredInterface |
||
66 | |||
67 | /** |
||
68 | * @return iterable|DeferredInterface[] |
||
69 | */ |
||
70 | private function getDeferredResolvers(): iterable |
||
76 | |||
77 | /** |
||
78 | * @param mixed $value |
||
79 | * @return mixed |
||
80 | */ |
||
81 | private function runDeferredResolvers($value) |
||
89 | |||
90 | /** |
||
91 | * @param \Generator $process |
||
92 | * @return mixed |
||
93 | */ |
||
94 | private function coroutine(\Generator $process) |
||
102 | |||
103 | /** |
||
104 | * @param callable $handler |
||
105 | * @return ProcessInterface |
||
106 | */ |
||
107 | public function tick(callable $handler): ProcessInterface |
||
113 | |||
114 | /** |
||
115 | * @param mixed $value |
||
116 | * @return mixed |
||
117 | */ |
||
118 | private function each($value) |
||
122 | |||
123 | /** |
||
124 | * @param array $interceptors |
||
125 | * @param mixed $value |
||
126 | * @return mixed |
||
127 | */ |
||
128 | private function reduce(array $interceptors, $value) |
||
140 | |||
141 | /** |
||
142 | * @param array $items |
||
143 | * @param int $index |
||
144 | * @return array |
||
145 | */ |
||
146 | private function arrayExcept(array $items, int $index): array |
||
152 | |||
153 | /** |
||
154 | * @param mixed $value |
||
155 | * @return mixed |
||
156 | */ |
||
157 | private function runTickHandlers($value) |
||
165 | |||
166 | /** |
||
167 | * @param InterceptorInterface $interceptor |
||
168 | * @return ProcessInterface |
||
169 | */ |
||
170 | public function intercept(InterceptorInterface $interceptor): ProcessInterface |
||
176 | |||
177 | /** |
||
178 | * @param mixed|\Generator $result |
||
179 | * @return \Generator |
||
180 | */ |
||
181 | public static function toGenerator($result): \Generator |
||
191 | } |
||
192 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: