Completed
Pull Request — master (#75)
by
unknown
02:24
created

MapsList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 36
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\Maps\ChatCommand;
5
6
use eXpansion\Bundle\Maps\Plugins\Gui\MapsWindowFactory;
7
use eXpansion\Bundle\Maps\Plugins\Maps;
8
use eXpansion\Framework\Core\Model\ChatCommand\AbstractChatCommand;
9
use Symfony\Component\Console\Input\InputInterface;
10
11
12
/**
13
 * Class Records
14
 *
15
 * @package eXpansion\Bundle\LocalRecords\ChatCommand;
16
 * @author  reaby
17
 */
18
class MapsList extends AbstractChatCommand
19
{
20
    /** @var MapsWindowFactory */
21
    protected $mapsListWindowFactory;
22
23
    /** @var Maps */
24
    protected $mapsPlugin;
25
26
    /**
27
     * MapsList constructor.
28
     *
29
     * @param                      $command
30
     * @param array                $aliases
31
     */
32
    public function __construct(
33
        $command,
34
        array $aliases = [],
35
        MapsWindowFactory $mapsListWindowFactory,
36
        Maps $mapsPlugin
37
    )
38
    {
39
        parent::__construct($command, $aliases);
40
41
        $this->mapsListWindowFactory = $mapsListWindowFactory;
42
        $this->mapsPlugin = $mapsPlugin;
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function execute($login, InputInterface $input)
49
    {
50
        $this->mapsListWindowFactory->setMaps($this->mapsPlugin->getMaps());
51
        $this->mapsListWindowFactory->create($login);
52
    }
53
}
54