| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 2 | public function handleQuery(Query $query, callable $next, callable $first) |
|
|
|
|||
| 41 | { |
||
| 42 | 2 | $startTime = microtime(true); |
|
| 43 | 2 | $logger = $this->logger; |
|
| 44 | |||
| 45 | return $next($query)->then(function (Collection $result) use ($query, $startTime) { |
||
| 46 | 1 | $duration = (microtime(true) - $startTime) * 1000; |
|
| 47 | 1 | $this->logger->info(sprintf('[Geocoder] Got %d results in %0.2f ms for query %s', count($result), $duration, $query->__toString())); |
|
| 48 | |||
| 49 | 1 | return $result; |
|
| 50 | }, function (Exception $exception) use ($query, $startTime) { |
||
| 51 | 1 | $duration = (microtime(true) - $startTime) * 1000; |
|
| 52 | 1 | $this->logger->error(sprintf('[Geocoder] Failed with %s after %0.2f ms for query %s', get_class($exception), $duration, $query->__toString())); |
|
| 53 | |||
| 54 | 1 | throw $exception; |
|
| 55 | 2 | }); |
|
| 56 | } |
||
| 57 | } |
||
| 58 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.