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 | public function __construct($durationInDays, \Datetime $dateFrom, \Datetime $dateTo) |
||
44 | 2 | ||
45 | 2 | /** |
|
46 | * @return ArrayCollection |
||
47 | 2 | */ |
|
48 | 2 | public function generateDateCombinations() |
|
69 | |||
70 | /** |
||
71 | * @return int |
||
72 | */ |
||
73 | public function getDurationInDays() |
||
77 | |||
78 | /** |
||
79 | * @return \Datetime |
||
80 | */ |
||
81 | public function getDateFrom() |
||
85 | |||
86 | /** |
||
87 | * @return \Datetime |
||
88 | */ |
||
89 | public function getDateTo() |
||
93 | 2 | ||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | public function __toString() |
||
115 | |||
116 | /** |
||
117 | * @return \DateInterval |
||
118 | */ |
||
119 | private function getOneDayMore() { |
||
122 | } |
||
123 |
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.