Completed
Pull Request — master (#68)
by De Cramer
03:16
created

Records   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 37
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A execute() 0 5 1
1
<?php
2
3
4
namespace eXpansion\Bundle\LocalRecords\ChatCommand;
5
use eXpansion\Bundle\LocalRecords\Plugins\BaseRecords;
6
use eXpansion\Bundle\LocalRecords\Plugins\Gui\RecordsWindowFactory;
7
use eXpansion\Framework\Core\Model\ChatCommand\AbstractChatCommand;
8
use Symfony\Component\Console\Input\InputInterface;
9
10
11
/**
12
 * Class Records
13
 *
14
 * @package eXpansion\Bundle\LocalRecords\ChatCommand;
15
 * @author  oliver de Cramer <[email protected]>
16
 */
17
class Records extends AbstractChatCommand
18
{
19
    /** @var RecordsWindowFactory */
20
    protected $recordsWindowFactory;
21
22
    /** @var BaseRecords */
23
    protected $recordsPlugin;
24
25
    /**
26
     * Records constructor.
27
     *
28
     * @param                      $command
29
     * @param array                $aliases
30
     * @param RecordsWindowFactory $recordsWindowFactory
31
     */
32
    public function __construct(
33
        $command,
34
        array $aliases = [],
35
        RecordsWindowFactory $recordsWindowFactory,
36
        BaseRecords $recordsPlugin
37
    )
38
    {
39
        parent::__construct($command, $aliases);
40
41
        $this->recordsWindowFactory = $recordsWindowFactory;
42
        $this->recordsPlugin = $recordsPlugin;
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function execute($login, InputInterface $input)
49
    {
50
        $this->recordsWindowFactory->setRecordsData($this->recordsPlugin->getRecordsHandler()->getRecords());
51
        $this->recordsWindowFactory->create($login);
52
    }
53
}
54