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

LogProvider::log()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
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
}