| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 33 | public function beforeDispatchLoop(Event $event, AbstractDispatcher $dispatcher): void |
||
|
1 ignored issue
–
show
|
|||
| 34 | { |
||
| 35 | if ($this->isEnabled()) { |
||
| 36 | if ($this->config->path('logger.dispatcher')) { |
||
| 37 | |||
| 38 | $session = $this->identity->getSession(); |
||
| 39 | $sessionId = $session ? $session->readAttribute('id') : null; |
||
| 40 | $userId = $this->identity->getUserId(); |
||
| 41 | $userAsId = $this->identity->getUserAsId(); |
||
| 42 | |||
| 43 | $log = json_encode([ |
||
| 44 | 'type' => 'dispatch', |
||
| 45 | 'sessionId' => $sessionId, |
||
| 46 | 'userId' => $userId, |
||
| 47 | 'userAsId' => $userAsId, |
||
| 48 | 'meta' => [ |
||
| 49 | 'dispatch' => $dispatcher->toArray(), |
||
| 50 | ], |
||
| 51 | ]); |
||
| 52 | |||
| 53 | $this->logger->info($log); |
||
| 54 | } |
||
| 58 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.