1 | <?php |
||
16 | class Path implements \Countable |
||
17 | { |
||
18 | /** @var Point[] */ |
||
19 | private $points; |
||
20 | |||
21 | /** |
||
22 | * @param Point[] $points |
||
23 | */ |
||
24 | public function __construct(array $points) |
||
35 | |||
36 | /** |
||
37 | * @return Point[] |
||
38 | */ |
||
39 | public function getPoints() |
||
43 | |||
44 | /** |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function isMonotonouslyIncreasingX() |
||
51 | |||
52 | /** |
||
53 | * @return bool |
||
54 | */ |
||
55 | public function isMonotonouslyIncreasingY() |
||
59 | |||
60 | /** |
||
61 | * @return int|float[] |
||
62 | */ |
||
63 | public function getAllX() |
||
69 | |||
70 | /** |
||
71 | * @return int|float[] |
||
72 | */ |
||
73 | public function getAllY() |
||
79 | |||
80 | /** |
||
81 | * @return int |
||
82 | */ |
||
83 | public function count() |
||
87 | |||
88 | /** |
||
89 | * @return Point|null |
||
90 | */ |
||
91 | public function firstPoint() |
||
95 | |||
96 | /** |
||
97 | * @return Point|null |
||
98 | */ |
||
99 | public function lastPoint() |
||
103 | |||
104 | /** |
||
105 | * @return Line |
||
106 | */ |
||
107 | public function firstLine() |
||
111 | |||
112 | public function lastLine() |
||
118 | |||
119 | /** |
||
120 | * @return LineIterator |
||
121 | */ |
||
122 | public function getLineIterator() |
||
126 | |||
127 | /** |
||
128 | * @return \ArrayIterator |
||
129 | */ |
||
130 | public function getPointIterator() |
||
134 | |||
135 | /** |
||
136 | * @param int[] $arr |
||
137 | * |
||
138 | * @return int|null Null if not monotonous, -1 if monotony decreasing, +1 if monotony increasing |
||
139 | */ |
||
140 | public function getMonotony(array $arr) |
||
160 | } |
||
161 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.