| Total Complexity | 3 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class FileLogger implements SQLLogger |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $file; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var float |
||
| 18 | */ |
||
| 19 | private $start; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | private $current; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | private $queries = []; |
||
| 30 | |||
| 31 | |||
| 32 | public function __construct(string $file) |
||
| 33 | { |
||
| 34 | $this->file = $file; |
||
| 35 | |||
| 36 | register_shutdown_function(function () { |
||
| 37 | file_put_contents($this->file, str_repeat('-', 100) . PHP_EOL . PHP_EOL, FILE_APPEND); |
||
| 38 | }); |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | public function startQuery($sql, array $params = NULL, array $types = NULL) |
||
| 46 | } |
||
| 47 | |||
| 48 | |||
| 49 | public function stopQuery() |
||
| 60 | } |
||
| 61 | |||
| 63 |