| @@ 40-52 (lines=13) @@ | ||
| 37 | $this->logger = $callable; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function startQuery($sql, array $params = null, array $types = null) |
|
| 41 | { |
|
| 42 | $this->queryId = \uniqid('', true); |
|
| 43 | ||
| 44 | $this->start = \microtime(true); |
|
| 45 | ||
| 46 | \call_user_func($this->logger, 'Query started', \array_merge( |
|
| 47 | $this->getStartQueryContext($sql, $params, $types), |
|
| 48 | [ |
|
| 49 | 'query_id' => $this->queryId, |
|
| 50 | ] |
|
| 51 | )); |
|
| 52 | } |
|
| 53 | ||
| 54 | protected function getStartQueryContext($sql, array $params = null, array $types = null) |
|
| 55 | { |
|
| @@ 66-78 (lines=13) @@ | ||
| 63 | return [$this->logger, $level]; |
|
| 64 | } |
|
| 65 | ||
| 66 | public function startQuery($sql, array $params = null, array $types = null) |
|
| 67 | { |
|
| 68 | $this->queryId = uniqid('', true); |
|
| 69 | ||
| 70 | $this->start = microtime(true); |
|
| 71 | ||
| 72 | call_user_func($this->startQueryCallable, 'Query started', array_merge( |
|
| 73 | $this->getStartQueryContext($sql, $params, $types), |
|
| 74 | [ |
|
| 75 | 'query_id' => $this->queryId, |
|
| 76 | ] |
|
| 77 | )); |
|
| 78 | } |
|
| 79 | ||
| 80 | protected function getStartQueryContext($sql, array $params = null, array $types = null) : array |
|
| 81 | { |
|