Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
58 | function setAsyncScheduler(LoopInterface $loop) |
||
59 | { |
||
60 | try { |
||
61 | Scheduler::setAsyncFactory(function () use ($loop) { |
||
62 | return new Scheduler\EventLoopScheduler($loop); |
||
|
|||
63 | }); |
||
64 | } catch (Exception $e) { |
||
65 | if ($e->getMessage() === 'The async factory can not be set after the scheduler has been created') { |
||
66 | return; |
||
67 | } |
||
68 | |||
69 | throw $e; |
||
70 | } |
||
71 | } |
||
72 |
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: