Completed
Pull Request — master (#154)
by De Cramer
02:58
created

AbstractFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
create() 0 1 ?
getVoteCode() 0 1 ?
getReplacementTypes() 0 1 ?
1
<?php
2
3
namespace eXpansion\Bundle\VoteManager\Services\VoteFactories;
4
use eXpansion\Bundle\VoteManager\Structures\AbstractVote;
5
use eXpansion\Framework\Core\Storage\Data\Player;
6
7
/**
8
 * Class AbstractFactory
9
 *
10
 * @author    de Cramer Oliver<[email protected]>
11
 * @copyright 2017 Smile
12
 * @package eXpansion\Bundle\VoteManager\Services\VoteFactories
13
 */
14
abstract class AbstractFactory
15
{
16
    /** @var int  */
17
    protected $duration;
18
19
    /** @var float */
20
    protected $ration;
21
22
    /**
23
     * AbstractFactory constructor.
24
     *
25
     * @param int $duration
26
     * @param float $ration
27
     */
28 4
    public function __construct(int $duration, float $ration)
29
    {
30 4
        $this->duration = $duration;
31 4
        $this->ration = $ration;
32 4
    }
33
34
    /**
35
     * Create a new vote.
36
     *
37
     * @param Player $player Player that started the vote.
38
     *
39
     * @return AbstractVote
40
     */
41
    public abstract function create(Player $player) : AbstractVote;
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
42
43
    /**
44
     * Get the code of the vote type.
45
     *
46
     * @return string
47
     */
48
    public abstract function getVoteCode() : string;
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
49
50
    /**
51
     * Get types of MP votes it replaces.
52
     *
53
     * @return array
54
     */
55
    public abstract function getReplacementTypes();
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
56
}