| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function handleQuery(Query $query, callable $next, callable $first) |
||
| 41 | { |
||
| 42 | $startTime = microtime(true); |
||
| 43 | $logger = $this->logger; |
||
| 44 | |||
| 45 | return $next($query)->then(function (Collection $result) use ($logger, $query, $startTime) { |
||
| 46 | $duration = (microtime(true) - $startTime) * 1000; |
||
| 47 | $this->logger->info(sprintf('[Geocoder] Got %d results in %0.2f ms for query %s', count($result), $duration, $query->__toString())); |
||
| 48 | |||
| 49 | return $result; |
||
| 50 | }, function (Exception $exception) use ($logger, $query, $startTime) { |
||
| 51 | $duration = (microtime(true) - $startTime) * 1000; |
||
| 52 | $this->logger->error(sprintf('[Geocoder] Failed with %s after %0.2f ms for query %s', get_class($exception), $duration, $query->__toString())); |
||
| 53 | |||
| 54 | throw $exception; |
||
| 55 | }); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.