Test Failed
Push — master ( 67b70b...c2443c )
by Mike
02:06
created

LogProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A log() 0 4 2
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Logger\Business\Provider;
6
7
8
use DataProvider\LogMessageDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\LogMessageDataProvider 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Xervice\Logger\Business\Handler\HandlerCollection;
10
11
class LogProvider implements LogProviderInterface
12
{
13
    /**
14
     * @var \Xervice\Logger\Business\Handler\HandlerCollection
15
     */
16
    private $handlerCollection;
17
18
    /**
19
     * LogProvider constructor.
20
     *
21
     * @param \Xervice\Logger\Business\Handler\HandlerCollection $handlerCollection
22
     */
23
    public function __construct(HandlerCollection $handlerCollection)
24
    {
25
        $this->handlerCollection = $handlerCollection;
26
    }
27
28
    /**
29
     * @param \DataProvider\LogMessageDataProvider $messageDataProvider
30
     */
31
    public function log(LogMessageDataProvider $messageDataProvider): void
32
    {
33
        foreach ($this->handlerCollection as $handler) {
34
            $handler->handleLog($messageDataProvider);
35
        }
36
    }
37
}