Completed
Push — master ( 30a2b5...89612e )
by Axel
02:59
created

Epic   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 102
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 15
eloc 29
dl 0
loc 102
ccs 0
cts 65
cp 0
rs 10
c 0
b 0
f 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A setSpentTime() 0 3 1
A setEstimatedTime() 0 5 1
A getStatus() 0 3 1
A getEstimatedTime() 0 3 1
A setUpdatedAt() 0 5 1
A setStatus() 0 5 1
A getCardType() 0 3 1
A setCreatedAt() 0 5 1
A getSpentTime() 0 3 1
A setId() 0 5 1
A getTitle() 0 3 1
A getCreatedAt() 0 3 1
A setTitle() 0 5 1
A getUpdatedAt() 0 3 1
1
<?php
2
3
namespace Scrumban\Model;
4
5
abstract class Epic implements CardInterface, EstimableInterface
6
{
7
    /** @var string **/
8
    protected $id;
9
    /** @var string **/
10
    protected $title;
11
    /** @var string **/
12
    protected $status;
13
    /** @var float **/
14
    protected $estimatedTime;
15
    /** @var float **/
16
    protected $spentTime;
17
    /** @var \DateTime **/
18
    protected $createdAt;
19
    /** @var \DateTime **/
20
    protected $updatedAt;
21
    
22
    public function getCardType(): string
23
    {
24
        return self::CARD_TYPE_EPIC;
25
    }
26
    
27
    public function setId(string $id): self
28
    {
29
        $this->id = $id;
30
        
31
        return $this;
32
    }
33
    
34
    public function getId(): string
35
    {
36
        return $this->id;
37
    }
38
39
    public function setTitle(string $title): self
40
    {
41
        $this->title = $title;
42
        
43
        return $this;
44
    }
45
    
46
    public function getTitle(): string
47
    {
48
        return $this->title;
49
    }
50
    
51
    public function setStatus(string $status): CardInterface
52
    {
53
        $this->status = $status;
54
        
55
        return $this;
56
    }
57
    
58
    public function getStatus(): string
59
    {
60
        return $this->status;
61
    }
62
    
63
    public function setEstimatedTime(float $estimatedTime): EstimableInterface
64
    {
65
        $this->estimatedTime = $estimatedTime;
66
        
67
        return $this;
68
    }
69
    
70
    public function getEstimatedTime(): float
71
    {
72
        return $this->getEstimatedTime();
73
    }
74
    
75
    public function setSpentTime(float $spentTime): EstimableInterface
76
    {
77
        $this->spentTime = $spentTime;
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Scrumban\Model\EstimableInterface. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
78
    }
79
    
80
    public function getSpentTime(): float
81
    {
82
        return $this->spentTime;
83
    }
84
    
85
    public function setCreatedAt(\DateTime $createdAt): self
86
    {
87
        $this->createdAt = $createdAt;
88
        
89
        return $this;
90
    }
91
    
92
    public function getCreatedAt(): \DateTime
93
    {
94
        return $this->createdAt;
95
    }
96
    
97
    public function setUpdatedAt(\DateTime $updatedAt): self
98
    {
99
        $this->updatedAt = $updatedAt;
100
        
101
        return $this;
102
    }
103
    
104
    public function getUpdatedAt(): \DateTime
105
    {
106
        return $this->updatedAt;
107
    }
108
}