Passed
Push — master ( dae0f1...427389 )
by Mike
08:24
created

Provider::provideCommands()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2.1481

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 0
dl 0
loc 4
ccs 2
cts 3
cp 0.6667
crap 2.1481
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Redis\Business\Model\Commands;
6
7
use Predis\Client;
8
9
class Provider implements ProviderInterface
10
{
11
    /**
12
     * @var \Xervice\Redis\Commands\Collection
0 ignored issues
show
Bug introduced by
The type Xervice\Redis\Commands\Collection 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...
13
     */
14
    private $commandCollection;
15
16
    /**
17
     * @var \Predis\Client
18
     */
19
    private $client;
20
21
    /**
22
     * Provider constructor.
23
     *
24
     * @param \Xervice\Redis\Commands\Collection $commandCollection
25
     * @param \Predis\Client $client
26
     */
27 8
    public function __construct(Collection $commandCollection, Client $client)
28
    {
29 8
        $this->commandCollection = $commandCollection;
0 ignored issues
show
Documentation Bug introduced by
It seems like $commandCollection of type Xervice\Redis\Business\Model\Commands\Collection is incompatible with the declared type Xervice\Redis\Commands\Collection of property $commandCollection.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30 8
        $this->client = $client;
31 8
    }
32
33
34 8
    public function provideCommands(): void
35
    {
36 8
        foreach ($this->commandCollection as $commandProvider) {
37
            $commandProvider->register($this->client);
38
        }
39 8
    }
40
}
41