Completed
Push — master ( 206125...47c10a )
by De Cramer
13s
created

NextMap::getVoteCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace eXpansion\Bundle\VoteManager\Services\VoteFactories;
4
5
use eXpansion\Bundle\VoteManager\Structures\AbstractVote;
6
use eXpansion\Bundle\VoteManager\Structures\NextMapVote;
7
use eXpansion\Framework\Core\Helpers\ChatNotification;
8
use eXpansion\Framework\Core\Storage\Data\Player;
9
use Maniaplanet\DedicatedServer\Connection;
10
11
/**
12
 * Class RestartMap
13
 *
14
 * @author    de Cramer Oliver<[email protected]>
15
 * @copyright 2017 Smile
16
 * @package eXpansion\Bundle\VoteManager\Services\VoteFactories
17
 */
18
class NextMap extends AbstractFactory
19
{
20
    /** @var Connection */
21
    protected $connection;
22
23
    /** @var ChatNotification */
24
    protected $chatNotification;
25
26
    /**
27
     * NextMap constructor.
28
     *
29
     * @param int $duration
30
     * @param float $ration
31
     * @param string $class
0 ignored issues
show
Bug introduced by
There is no parameter named $class. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
32
     * @param Connection $connection
33
     * @param ChatNotification $chatNotification
34
     */
35 2
    public function __construct(
36
        int $duration,
37
        float $ration,
38
        Connection $connection,
39
        ChatNotification $chatNotification
40
    ) {
41 2
        parent::__construct($duration, $ration);
42
43 2
        $this->connection = $connection;
44 2
        $this->chatNotification = $chatNotification;
45 2
    }
46
47
    /**
48
     * @inheritdoc
49
     */
50 1
    public function create(Player $player): AbstractVote
51
    {
52 1
        return new NextMapVote(
53 1
            $player,
54 1
            $this->getVoteCode(),
55 1
            $this->duration,
56 1
            $this->ration,
57 1
            $this->connection,
58 1
            $this->chatNotification
59
        );
60
    }
61
62
    /**
63
     * @inheritdoc
64
     */
65 2
    public function getVoteCode(): string
66
    {
67 2
        return 'Exp_NextMap';
68
    }
69
70
    /**
71
     * @inheritdoc
72
     */
73 1
    public function getReplacementTypes()
74
    {
75 1
        return ['NextMap'];
76
    }
77
}