Completed
Pull Request — master (#152)
by
unknown
02:44
created

Skip::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 5
cp 0
cc 1
eloc 8
nc 1
nop 4
crap 2
1
<?php
2
3
4
namespace eXpansion\Bundle\VoteManager\ChatCommand;
5
6
use eXpansion\Bundle\VoteManager\Plugins\VoteManager;
7
use eXpansion\Bundle\VoteManager\Services\VoteService;
8
use eXpansion\Framework\Core\Model\ChatCommand\AbstractChatCommand;
9
use eXpansion\Framework\Core\Storage\PlayerStorage;
10
use Symfony\Component\Console\Input\InputInterface;
11
12
13
/**
14
 * Class
15
 *
16
 * @package eXpansion\Bundle\LocalRecords\ChatCommand;
17
 * @author  reaby
18
 */
19 View Code Duplication
class Skip extends AbstractChatCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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;
0 ignored issues
show
Documentation Bug introduced by
It seems like $voteService of type object<eXpansion\Bundle\...r\Services\VoteService> is incompatible with the declared type object<eXpansion\Bundle\...er\Plugins\VoteManager> of property $voteService.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
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");
0 ignored issues
show
Bug introduced by
The method startVote() does not seem to exist on object<eXpansion\Bundle\...er\Plugins\VoteManager>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
57
    }
58
}
59