Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
28 | public function boot(): void |
||
29 | { |
||
30 | $this->getContainer()->share(LoggerInterface::class, function () { |
||
31 | $logger = new Logger('FondBot'); |
||
32 | $logger->pushHandler(new StreamHandler( |
||
33 | $this->getContainer()->get('resources_path').'/app.log' |
||
34 | )); |
||
35 | |||
36 | return $logger; |
||
37 | }); |
||
38 | |||
39 | $whoops = new Run; |
||
40 | $whoops->pushHandler(new PrettyPageHandler); |
||
|
|||
41 | $whoops->pushHandler(function (Exception $exception, $inspector, $run) { |
||
42 | /** @var LoggerInterface $logger */ |
||
43 | $logger = $this->getContainer()->get(LoggerInterface::class); |
||
44 | |||
45 | $logger->error($exception); |
||
46 | }); |
||
47 | $whoops->register(); |
||
48 | } |
||
49 | |||
61 |
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: