1 | <?php |
||
21 | class StepAggregator implements Workflow, LoggerAwareInterface |
||
22 | { |
||
23 | use LoggerAwareTrait; |
||
24 | |||
25 | /** |
||
26 | * @var Reader |
||
27 | */ |
||
28 | private $reader; |
||
29 | |||
30 | /** |
||
31 | * Identifier for the Import/Export |
||
32 | * |
||
33 | * @var string|null |
||
34 | */ |
||
35 | private $name = null; |
||
36 | |||
37 | /** |
||
38 | * @var boolean |
||
39 | */ |
||
40 | private $skipItemOnFailure = false; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | private $steps = []; |
||
46 | |||
47 | /** |
||
48 | * @var Writer[] |
||
49 | */ |
||
50 | private $writers = []; |
||
51 | |||
52 | /** |
||
53 | * @param Reader $reader |
||
54 | * @param string $name |
||
55 | */ |
||
56 | 7 | public function __construct(Reader $reader, $name = null) |
|
64 | |||
65 | /** |
||
66 | * Add a step to the current workflow |
||
67 | * |
||
68 | * @param Step $step |
||
69 | * @param integer|null $priority |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | 1 | public function addStep(Step $step, $priority = null) |
|
82 | |||
83 | /** |
||
84 | * Add a new writer to the current workflow |
||
85 | * |
||
86 | * @param Writer $writer |
||
87 | * |
||
88 | * @return $this |
||
89 | */ |
||
90 | 5 | public function addWriter(Writer $writer) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 4 | public function process() |
|
142 | |||
143 | /** |
||
144 | * Sets the value which determines whether the item should be skipped when error occures |
||
145 | * |
||
146 | * @param boolean $skipItemOnFailure When true skip current item on process exception and log the error |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | 1 | public function setSkipItemOnFailure($skipItemOnFailure) |
|
156 | |||
157 | /** |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getName() |
||
164 | |||
165 | /** |
||
166 | * Builds the pipeline |
||
167 | * |
||
168 | * @return callable |
||
169 | */ |
||
170 | 4 | private function buildPipeline() |
|
184 | |||
185 | /** |
||
186 | * Sorts the internal list of steps and writers by priority in reverse order. |
||
187 | * |
||
188 | * @return Step[] |
||
189 | */ |
||
190 | 4 | private function getStepsSortedDescByPriority() |
|
211 | } |
||
212 |
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: