| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Monolog |
||
| 9 | { |
||
| 10 | public static function log($message, array $context = [], $type = 'info', $level = 0) |
||
| 11 | { |
||
| 12 | self::getType($type); |
||
| 13 | |||
| 14 | try { |
||
| 15 | $log = self::registerLog(); |
||
| 16 | $debug = \debug_backtrace()[$level]; |
||
| 17 | $details = [ |
||
| 18 | $debug['file'], |
||
| 19 | $debug['line'], |
||
| 20 | ]; |
||
| 21 | $context = !empty($context) ? \array_merge($context, $details) : $details; |
||
| 22 | |||
| 23 | $log->{strtolower($type)}($message, $context); |
||
| 24 | } catch (\Exception $exception) { |
||
| 25 | |||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | private static function getType(&$type) |
||
| 30 | { |
||
| 31 | if (!\array_key_exists(\strtoupper($type), Logger::getLevels())) { |
||
| 32 | $type = Logger::getLevelName(Logger::INFO); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @throws \Exception |
||
| 38 | */ |
||
| 39 | public static function registerLog() |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
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