1 | <?php |
||
2 | |||
3 | namespace ControleOnline\Service; |
||
4 | |||
5 | use Monolog\Logger; |
||
0 ignored issues
–
show
|
|||
6 | use Monolog\Handler\StreamHandler; |
||
0 ignored issues
–
show
The type
Monolog\Handler\StreamHandler was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
7 | use Psr\Log\LoggerInterface; |
||
0 ignored issues
–
show
The type
Psr\Log\LoggerInterface was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
8 | use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; |
||
0 ignored issues
–
show
The type
Symfony\Component\Depend...g\ParameterBagInterface was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
9 | |||
10 | class LoggerService |
||
11 | { |
||
12 | private static $loggers = []; |
||
13 | private string $logsDir; |
||
14 | |||
15 | public function __construct(ParameterBagInterface $parameterBag) |
||
16 | { |
||
17 | $this->logsDir = $parameterBag->get('kernel.logs_dir'); |
||
18 | } |
||
19 | |||
20 | public function getLogger(string $name): LoggerInterface |
||
21 | { |
||
22 | if (!isset(self::$loggers[$name])) { |
||
23 | $logger = new Logger($name); |
||
24 | $logger->pushHandler(new StreamHandler( |
||
25 | $this->logsDir . '/' . $name . '.log', |
||
26 | Logger::INFO |
||
27 | )); |
||
28 | self::$loggers[$name] = $logger; |
||
29 | } |
||
30 | |||
31 | return self::$loggers[$name]; |
||
32 | } |
||
33 | } |
||
34 |
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