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

AbstractFactory::create()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
ccs 0
cts 0
cp 0
nc 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
}