Code Duplication    Length = 40-40 lines in 2 locations

src/eXpansion/Bundle/VoteManager/ChatCommand/Restart.php 1 location

@@ 19-58 (lines=40) @@
16
 * @package eXpansion\Bundle\LocalRecords\ChatCommand;
17
 * @author  reaby
18
 */
19
class Restart extends AbstractChatCommand
20
{
21
    /**
22
     * @var VoteManager
23
     */
24
    private $voteService;
25
    /**
26
     * @var PlayerStorage
27
     */
28
    private $playerStorage;
29
30
31
    /**
32
     * MapsList constructor.
33
     *
34
     * @param                      $command
35
     * @param array $aliases
36
     * @param VoteService $voteService
37
     * @param PlayerStorage $playerStorage
38
     */
39
    public function __construct(
40
        $command,
41
        array $aliases = [],
42
        VoteService $voteService,
43
        PlayerStorage $playerStorage
44
    ) {
45
        parent::__construct($command, $aliases);
46
        $this->voteService = $voteService;
47
        $this->playerStorage = $playerStorage;
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function execute($login, InputInterface $input)
54
    {
55
        $player = $this->playerStorage->getPlayerInfo($login);
56
        $this->voteService->startVote($player, "Exp_RestartMap");
57
    }
58
}
59

src/eXpansion/Bundle/VoteManager/ChatCommand/Skip.php 1 location

@@ 19-58 (lines=40) @@
16
 * @package eXpansion\Bundle\LocalRecords\ChatCommand;
17
 * @author  reaby
18
 */
19
class Skip extends AbstractChatCommand
20
{
21
    /**
22
     * @var VoteManager
23
     */
24
    private $voteService;
25
    /**
26
     * @var PlayerStorage
27
     */
28
    private $playerStorage;
29
30
31
    /**
32
     * MapsList constructor.
33
     *
34
     * @param                      $command
35
     * @param array $aliases
36
     * @param VoteService $voteService
37
     * @param PlayerStorage $playerStorage
38
     */
39
    public function __construct(
40
        $command,
41
        array $aliases = [],
42
        VoteService $voteService,
43
        PlayerStorage $playerStorage
44
    ) {
45
        parent::__construct($command, $aliases);
46
        $this->voteService = $voteService;
47
        $this->playerStorage = $playerStorage;
48
    }
49
50
    /**
51
     * @inheritdoc
52
     */
53
    public function execute($login, InputInterface $input)
54
    {
55
        $player = $this->playerStorage->getPlayerInfo($login);
56
        $this->voteService->startVote($player, "Exp_NextMap");
57
    }
58
}
59