Provider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 29
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A provideCommands() 0 4 2
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