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
|
|||
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 | } |
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: