Provider::provideCommands()   A
last analyzed

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\Business\Model\Commands\Collection
13
     */
14
    private $commandCollection;
15
16
    /**
17
     * @var \Predis\Client
18
     */
19
    private $client;
20
21
    /**
22
     * Provider constructor.
23
     *
24
     * @param \Xervice\Redis\Business\Model\Commands\Collection $commandCollection
25
     * @param \Predis\Client $client
26
     */
27 8
    public function __construct(Collection $commandCollection, Client $client)
28
    {
29 8
        $this->commandCollection = $commandCollection;
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