| Total Complexity | 10 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class QueryLoggers { |
||
| 7 | /** @var QueryLogger[] */ |
||
| 8 | private array $queryLoggers = []; |
||
| 9 | |||
| 10 | public function add(QueryLogger $queryLogger): void { |
||
| 12 | } |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @template T |
||
| 16 | * @param string $query |
||
| 17 | * @param callable(): T $fn |
||
| 18 | * @return T |
||
|
|
|||
| 19 | */ |
||
| 20 | public function logRegion(string $query, $fn) { |
||
| 21 | $exception = null; |
||
| 22 | $timer = microtime(true); |
||
| 23 | try { |
||
| 24 | return $fn(); |
||
| 25 | } catch(Throwable $e) { |
||
| 26 | $exception = $e; |
||
| 27 | throw $e; |
||
| 28 | } finally { |
||
| 29 | $finalTimer = microtime(true) - $timer; |
||
| 30 | if($exception === null) { |
||
| 31 | $this->log($query, $finalTimer); |
||
| 32 | } else { |
||
| 33 | $this->logError($query, $exception, $finalTimer); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $query |
||
| 40 | * @param float $duration |
||
| 41 | */ |
||
| 42 | public function log(string $query, float $duration): void { |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $query |
||
| 52 | * @param Throwable $exception |
||
| 53 | * @param float $duration |
||
| 54 | */ |
||
| 55 | public function logError(string $query, Throwable $exception, float $duration): void { |
||
| 60 | } |
||
| 61 | } |
||
| 63 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths