CommandCollector   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 3 1
A collect() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
namespace Startwind\Inventorio\Collector\Inventorio;
4
5
use Startwind\Inventorio\Collector\Collector;
6
use Startwind\Inventorio\Config\Config;
7
8
/**
9
 * This collector returns details about this Inventorio client
10
 */
11
class CommandCollector implements Collector
12
{
13
    protected const COLLECTION_IDENTIFIER = '_InventorioCommands';
14
    private array $commands;
15
16
    public function __construct(Config $config)
17
    {
18
        $this->commands = $config->getCommands();
19
    }
20
21
    /**
22
     * @inheritDoc
23
     */
24
    public function getIdentifier(): string
25
    {
26
        return self::COLLECTION_IDENTIFIER;
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function collect(): array
33
    {
34
        return [
35
            'commands' => $this->commands
36
        ];
37
    }
38
}
39