|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Valkyrja Framework package. |
|
7
|
|
|
* |
|
8
|
|
|
* (c) Melech Mizrachi <[email protected]> |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Valkyrja\Log\Logger\Abstract; |
|
15
|
|
|
|
|
16
|
|
|
use Override; |
|
|
|
|
|
|
17
|
|
|
use Stringable; |
|
18
|
|
|
use Valkyrja\Log\Enum\LogLevel; |
|
19
|
|
|
use Valkyrja\Log\Logger\Contract\LoggerContract; |
|
20
|
|
|
use Valkyrja\Log\Throwable\Exception\InvalidArgumentException; |
|
21
|
|
|
|
|
22
|
|
|
abstract class Logger implements LoggerContract |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* @inheritDoc |
|
26
|
|
|
*/ |
|
27
|
|
|
#[Override] |
|
28
|
|
|
public function log($level, string|Stringable $message, array $context = []): void |
|
29
|
|
|
{ |
|
30
|
|
|
if (! $level instanceof LogLevel) { |
|
31
|
|
|
throw new InvalidArgumentException('Invalid log level passed. Expecting instance of' . LogLevel::class); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
match ($level) { |
|
35
|
|
|
LogLevel::ALERT => $this->alert($message, $context), |
|
|
|
|
|
|
36
|
|
|
LogLevel::DEBUG => $this->debug($message, $context), |
|
|
|
|
|
|
37
|
|
|
LogLevel::INFO => $this->info($message, $context), |
|
|
|
|
|
|
38
|
|
|
LogLevel::NOTICE => $this->notice($message, $context), |
|
|
|
|
|
|
39
|
|
|
LogLevel::WARNING => $this->warning($message, $context), |
|
|
|
|
|
|
40
|
|
|
LogLevel::ERROR => $this->error($message, $context), |
|
|
|
|
|
|
41
|
|
|
LogLevel::CRITICAL => $this->critical($message, $context), |
|
|
|
|
|
|
42
|
|
|
LogLevel::EMERGENCY => $this->emergency($message, $context), |
|
|
|
|
|
|
43
|
|
|
}; |
|
44
|
|
|
} |
|
45
|
|
|
} |
|
46
|
|
|
|
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