| Total Complexity | 3 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 88.24% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | #[Injectable] |
||
| 12 | class JSConsoleLogger extends BaseLogger |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Table information. |
||
| 16 | * |
||
| 17 | * @param string | Stringable $message |
||
| 18 | * @param array $context |
||
| 19 | * @return void |
||
| 20 | */ |
||
| 21 | public function table(string | Stringable $message, array $context = []): void |
||
| 22 | { |
||
| 23 | $this->log('table', $message, $context); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Logs with an arbitrary level. |
||
| 28 | * |
||
| 29 | * @param mixed $level |
||
| 30 | * @param string | Stringable $message |
||
| 31 | * @param array $context |
||
| 32 | * @return void |
||
| 33 | */ |
||
| 34 | 9 | public function log(mixed $level, string | Stringable $message, array $context = []): void |
|
| 35 | { |
||
| 36 | 9 | $text = $this->interpolate($message, $context); |
|
| 37 | 9 | $jsMethod = match ($level) { |
|
| 38 | 1 | LogLevel::ERROR => 'error', |
|
| 39 | 1 | LogLevel::DEBUG => 'debug', |
|
| 40 | 1 | LogLevel::INFO => 'info', |
|
| 41 | 1 | LogLevel::WARNING => 'warn', |
|
| 42 | 5 | default => 'log', |
|
| 43 | }; |
||
| 44 | |||
| 45 | 9 | echo "<script>".printf( |
|
| 46 | "console.%s('%s [%s] %s');", |
||
| 47 | $jsMethod, |
||
| 48 | 9 | date('y-m-d H:i:s'), |
|
| 49 | $level, |
||
| 50 | 9 | $this->stringFormat($text), |
|
| 51 | )."</script>"; |
||
| 52 | } |
||
| 53 | |||
| 54 | 9 | private function stringFormat(string $input): string |
|
| 60 | } |
||
| 61 | } |
||
| 62 |
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