1 | <?php |
||
10 | class Period |
||
11 | { |
||
12 | /** |
||
13 | * @var int |
||
14 | */ |
||
15 | private $durationInDays; |
||
16 | |||
17 | /** |
||
18 | * @var \Datetime |
||
19 | */ |
||
20 | private $dateFrom; |
||
21 | |||
22 | /** |
||
23 | * @var \Datetime |
||
24 | */ |
||
25 | private $dateTo; |
||
26 | |||
27 | /** |
||
28 | * @var ArrayCollection |
||
29 | */ |
||
30 | private $combinations; |
||
31 | |||
32 | /** |
||
33 | * @param int $durationInDays |
||
34 | * @param \Datetime $dateFrom |
||
35 | * @param \Datetime $dateTo |
||
36 | */ |
||
37 | 4 | public function __construct($durationInDays, \Datetime $dateFrom, \Datetime $dateTo) |
|
48 | |||
49 | /** |
||
50 | * @return ArrayCollection |
||
51 | */ |
||
52 | 3 | public function generateDateCombinations() |
|
77 | |||
78 | /** |
||
79 | * @return int |
||
80 | */ |
||
81 | public function getDurationInDays() |
||
85 | |||
86 | /** |
||
87 | * @return \Datetime |
||
88 | */ |
||
89 | public function getDateFrom() |
||
93 | |||
94 | /** |
||
95 | * @return \Datetime |
||
96 | */ |
||
97 | public function getDateTo() |
||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function __toString() |
||
123 | |||
124 | /** |
||
125 | * @return \DateInterval |
||
126 | */ |
||
127 | 2 | private function getOneDayMore() |
|
131 | } |
||
132 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.