1 | <?php |
||
32 | class FetchCommand extends Command |
||
33 | { |
||
34 | use LoggerAwareTrait; |
||
35 | |||
36 | /** |
||
37 | * @var ManagerInterface |
||
38 | */ |
||
39 | protected $manager; |
||
40 | |||
41 | /** |
||
42 | * @var SourcesRegistryInterface |
||
43 | */ |
||
44 | protected $sourcesRegistry; |
||
45 | |||
46 | /** |
||
47 | * @var SymfonyStyle |
||
48 | */ |
||
49 | protected $outputStyle; |
||
50 | |||
51 | /** |
||
52 | * @var NotificationInterface[] |
||
53 | */ |
||
54 | protected $successNotifications; |
||
55 | |||
56 | /** |
||
57 | * @var NotificationInterface[] |
||
58 | */ |
||
59 | protected $errorNotifications; |
||
60 | |||
61 | public function __construct(ManagerInterface $manager, SourcesRegistryInterface $sourcesRegistry) |
||
69 | |||
70 | /** |
||
71 | * Add success notification to command notifications stack. |
||
72 | * |
||
73 | * @param NotificationInterface $notification Success notification to add. |
||
74 | * @return FetchCommand $this Fluent interface. |
||
75 | */ |
||
76 | public function addSuccessNotification(NotificationInterface $notification) |
||
81 | |||
82 | /** |
||
83 | * Add error notification to command notifications stack. |
||
84 | * |
||
85 | * @param NotificationInterface $notification Error notification to add. |
||
86 | * @return FetchCommand $this Fluent interface. |
||
87 | */ |
||
88 | public function addErrorNotification(NotificationInterface $notification) |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | protected function configure() |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | protected function execute(InputInterface $input, OutputInterface $output) |
||
163 | |||
164 | /** |
||
165 | * Clean date from console input. |
||
166 | * |
||
167 | * @param InputInterface $input Console input. |
||
168 | * @param OutputStyle $outputStyle Output style to use. |
||
169 | * @return FetchCommand $this Fluent interface. |
||
170 | * |
||
171 | * @throws \Exception |
||
172 | */ |
||
173 | protected function cleanInputDate(InputInterface $input, OutputStyle $outputStyle) |
||
192 | |||
193 | /** |
||
194 | * Clean sources from console input. |
||
195 | * |
||
196 | * @param InputInterface $input Console input. |
||
197 | * @param OutputStyle $outputStyle Output style to use. |
||
198 | * @return FetchCommand $this Fluent interface. |
||
199 | * |
||
200 | * @throws \Exception |
||
201 | */ |
||
202 | protected function cleanInputSources(InputInterface $input, OutputStyle $outputStyle) |
||
226 | |||
227 | /** |
||
228 | * Display command begin note. |
||
229 | * |
||
230 | * @param InputInterface $input Console input. |
||
231 | * @param OutputStyle $outputStyle Console style. |
||
232 | * @return FetchCommand $this Fluent interface. |
||
233 | */ |
||
234 | protected function displayCommandBegin(InputInterface $input, OutputStyle $outputStyle) |
||
247 | |||
248 | /** |
||
249 | * Do fetch rates. |
||
250 | * |
||
251 | * @param InputInterface $input Console input. |
||
252 | * @return RateInterface[] Fetched rates. |
||
253 | * @throws \Exception |
||
254 | */ |
||
255 | protected function doFetch(InputInterface $input) |
||
282 | |||
283 | /** |
||
284 | * Display command success note. |
||
285 | * |
||
286 | * @param OutputStyle $outputStyle |
||
287 | * @return FetchCommand $this Fluent interface. |
||
288 | */ |
||
289 | protected function displayCommandSuccess(OutputStyle $outputStyle) |
||
294 | |||
295 | /** |
||
296 | * Display command error note. |
||
297 | * |
||
298 | * @param OutputStyle $outputStyle |
||
299 | * @return FetchCommand $this Fluent interface. |
||
300 | */ |
||
301 | protected function displayCommandError(OutputStyle $outputStyle) |
||
306 | |||
307 | /** |
||
308 | * Dispatch success notifications. |
||
309 | * |
||
310 | * @param null|array $source Sources for which command is executed. |
||
311 | * @param \DateTime $date Date for which rates are fetched. |
||
312 | * @param RateInterface[] $rates Fetched rates |
||
313 | * @return FetchCommand $this Fluent interface. |
||
314 | */ |
||
315 | protected function dispatchSuccessNotifications($source, \DateTime $date, array $rates) |
||
328 | |||
329 | /** |
||
330 | * Dispatch error notifications. |
||
331 | * |
||
332 | * @param null|array $source Sources for which command is executed. |
||
333 | * @param \DateTime $date Date for which rates are fetched. |
||
334 | * @return FetchCommand $this Fluent interface. |
||
335 | */ |
||
336 | protected function dispatchErrorNotifications($source, \DateTime $date) |
||
348 | } |
||
349 |
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: