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 | * @param int $durationInDays |
||
29 | * @param \Datetime $dateFrom |
||
30 | * @param \Datetime $dateTo |
||
31 | */ |
||
32 | public function __construct($durationInDays, \Datetime $dateFrom, \Datetime $dateTo) |
||
38 | |||
39 | /** |
||
40 | * @return ArrayCollection |
||
41 | */ |
||
42 | 2 | public function generateDateCombinations() |
|
64 | |||
65 | /** |
||
66 | * @return int |
||
67 | */ |
||
68 | public function getDurationInDays() |
||
72 | |||
73 | /** |
||
74 | * @return \Datetime |
||
75 | */ |
||
76 | public function getDateFrom() |
||
80 | |||
81 | /** |
||
82 | * @return \Datetime |
||
83 | */ |
||
84 | public function getDateTo() |
||
88 | |||
89 | /** |
||
90 | * @return \DateInterval |
||
91 | */ |
||
92 | 2 | private function getOneDayMore() { |
|
95 | } |
||
96 |
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.