1 | <?php |
||
14 | class SiteMapUrlCollection implements \Iterator, \Countable |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * The array containing the entries of this collection. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | private $elements = array(); |
||
23 | |||
24 | /** |
||
25 | * The iterator cursor |
||
26 | * |
||
27 | * @var int |
||
28 | */ |
||
29 | private $index = 0; |
||
30 | |||
31 | /** |
||
32 | * Initializes a new SiteMapUrlCollection. |
||
33 | * |
||
34 | * @param array $elements |
||
35 | */ |
||
36 | public function __construct(array $elements = array()) |
||
42 | |||
43 | /** |
||
44 | * @param SiteMapUrl $siteMapUrl |
||
45 | * @return SiteMapUrl |
||
46 | */ |
||
47 | public function add(SiteMapUrl $siteMapUrl) |
||
51 | |||
52 | /** |
||
53 | * @param $offset |
||
54 | * @param SiteMapUrl $siteMapUrl |
||
55 | * @return SiteMapUrl |
||
56 | */ |
||
57 | public function set($offset, SiteMapUrl $siteMapUrl) |
||
61 | |||
62 | /** |
||
63 | * Required by interface Countable. |
||
64 | * |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | public function count() |
||
71 | |||
72 | /** |
||
73 | * @return array |
||
74 | */ |
||
75 | public function toArray() |
||
79 | |||
80 | /** |
||
81 | * Required by interface Iterator. |
||
82 | * |
||
83 | * {@inheritDoc} |
||
84 | */ |
||
85 | public function current() |
||
90 | |||
91 | /** |
||
92 | * Required by interface Iterator. |
||
93 | * |
||
94 | * {@inheritDoc} |
||
95 | */ |
||
96 | public function next() |
||
101 | |||
102 | /** |
||
103 | * Required by interface Iterator. |
||
104 | * |
||
105 | * {@inheritDoc} |
||
106 | */ |
||
107 | public function key() |
||
112 | |||
113 | /** |
||
114 | * Required by interface Iterator. |
||
115 | * |
||
116 | * {@inheritDoc} |
||
117 | */ |
||
118 | public function valid() |
||
123 | |||
124 | /** |
||
125 | * Required by interface Iterator. |
||
126 | * |
||
127 | * {@inheritDoc} |
||
128 | */ |
||
129 | public function rewind() |
||
134 | |||
135 | } |
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.