| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 21 | public function execute($command, callable $next) |
||
| 22 | { |
||
| 23 | $levels = $this->app->config->get('tactician.log.levels'); |
||
| 24 | $formatter = $this->app->make($this->app->config->get('tactician.log.formatter')); |
||
| 25 | |||
| 26 | $this->log($levels['received'], $formatter->commandReceived($command)); |
||
| 27 | |||
| 28 | try { |
||
| 29 | $returnValue = $next($command); |
||
| 30 | } catch (Exception $exception) { |
||
| 31 | $this->log($levels['failed'], $formatter->commandFailed($command, $exception)); |
||
| 32 | |||
| 33 | throw $exception; |
||
| 34 | } catch (Throwable $exception) { |
||
|
|
|||
| 35 | $this->log($levels['failed'], $formatter->commandFailed($command, $exception)); |
||
| 36 | |||
| 37 | throw $exception; |
||
| 38 | } |
||
| 39 | |||
| 40 | $this->log($levels['handled'], $formatter->commandHandled($command)); |
||
| 41 | |||
| 42 | return $returnValue; |
||
| 43 | } |
||
| 44 | |||
| 52 |