| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class DatabaseLog extends LogOutputAbstract{ |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var \chillerlan\Database\Database |
||
| 22 | */ |
||
| 23 | protected $db; |
||
| 24 | |||
| 25 | /** @noinspection PhpMissingParentConstructorInspection */ |
||
| 26 | /** |
||
| 27 | * DatabaseLog constructor. |
||
| 28 | * |
||
| 29 | * @param \chillerlan\Settings\SettingsContainerInterface|null $options |
||
| 30 | * @param \chillerlan\Database\Database $db |
||
| 31 | */ |
||
| 32 | public function __construct(SettingsContainerInterface $options, Database $db){ |
||
| 33 | $this->options = $options; |
||
| 34 | $this->db = $db; |
||
| 35 | |||
| 36 | $this->db->connect(); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @inheritdoc |
||
| 41 | */ |
||
| 42 | protected function __log(string $level, string $message, array $context = []){ |
||
| 43 | |||
| 44 | // TODO: $context, tests |
||
| 45 | $this->db->insert |
||
| 46 | ->into($this->options->dbLogTable) |
||
| 47 | ->values([ |
||
| 48 | 'level' => $level, |
||
| 49 | 'message' => $message, |
||
| 50 | 'context' => json_encode($context), |
||
| 51 | 'time' => time(), |
||
| 52 | ]) |
||
| 53 | ->query() |
||
| 54 | ; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @inheritdoc |
||
| 59 | */ |
||
| 60 | public function close():LogOutputInterface{ |
||
| 64 | } |
||
| 65 | |||
| 66 | } |
||
| 67 |
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