Completed
Push — master ( 1e7ae1...1641c1 )
by Axel
04:29
created

Vote   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 78
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreatedAt() 0 3 1
A setOption() 0 5 1
A getOption() 0 3 1
A setCreatedAt() 0 5 1
A getUser() 0 3 1
A setPoll() 0 5 1
A setIsPositive() 0 5 1
A setUser() 0 5 1
A getIsPositive() 0 3 1
A getPoll() 0 3 1
1
<?php
2
3
namespace App\Model\Project;
4
5
use Symfony\Component\Security\Core\User\UserInterface;
6
7
abstract class Vote
8
{
9
    /** @var Poll **/
10
    protected $poll;
11
    /** @var UserInterface **/
12
    protected $user;
13
    /** @var string **/
14
    protected $option;
15
    /** @var bool **/
16
    protected $isPositive;
17
    /** @var \DateTime **/
18
    protected $createdAt;
19
    
20
    const OPTION_POSITIVE_TECH = 'positive.tech';
21
    const OPTION_POSITIVE_PURPOSE = 'positive.purpose';
22
    
23
    const OPTION_NEGATIVE_TECH = 'negative.tech';
24
    const OPTION_NEGATIVE_PURPOSE = 'negative.purpose';
25
    const OPTION_NEGATIVE_INFOS = 'negative.infos';
26
    
27
    public function setPoll(Poll $poll): Vote
28
    {
29
        $this->poll = $poll;
30
        
31
        return $this;
32
    }
33
    
34
    public function getPoll(): Poll
35
    {
36
        return $this->poll;
37
    }
38
    
39
    public function setUser(UserInterface $user): Vote
40
    {
41
        $this->user = $user;
42
        
43
        return $this;
44
    }
45
    
46
    public function getUser(): UserInterface
47
    {
48
        return $this->user;
49
    }
50
    
51
    public function setOption(string $option): Vote
52
    {
53
        $this->option = $option;
54
        
55
        return $this;
56
    }
57
    
58
    public function getOption(): string
59
    {
60
        return $this->option;
61
    }
62
    
63
    public function setIsPositive(bool $isPositive): Vote
64
    {
65
        $this->isPositive = $isPositive;
66
        
67
        return $this;
68
    }
69
    
70
    public function getIsPositive(): bool
71
    {
72
        return $this->isPositive;
73
    }
74
    
75
    public function setCreatedAt(\DateTime $createdAt): Vote
76
    {
77
        $this->createdAt = $createdAt;
78
        
79
        return $this;
80
    }
81
    
82
    public function getCreatedAt(): \DateTime
83
    {
84
        return $this->createdAt;
85
    }
86
}