1 | <?php |
||
35 | class ArrayList extends AbstractCollection |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * Holds the internal counter for the keys of the ArrayList. |
||
40 | * |
||
41 | * @var integer |
||
42 | */ |
||
43 | protected $count = 0; |
||
44 | |||
45 | /** |
||
46 | * Standard constructor that adds the array passed |
||
47 | * as parameter to the internal member variable. |
||
48 | * |
||
49 | * @param array $items An array to initialize the ArrayList |
||
50 | * |
||
51 | * @throws \AppserverIo\Lang\ClassCastException |
||
52 | */ |
||
53 | 7 | public function __construct($items = null) |
|
74 | |||
75 | /** |
||
76 | * This method adds the passed object with the passed key |
||
77 | * to the ArrayList. |
||
78 | * |
||
79 | * @param mixed $object The object that should be added to the ArrayList |
||
80 | * |
||
81 | * @return \AppserverIo\Collections\ArrayList The instance |
||
82 | * @throws \AppserverIo\Lang\NullPointerException Is thrown it the passed object is NULL |
||
83 | */ |
||
84 | 6 | public function add($object) |
|
94 | |||
95 | /** |
||
96 | * This method Returns a new ArrayList initialized with the |
||
97 | * passed array. |
||
98 | * |
||
99 | * @param array $array Holds the array to initialize the new ArrayList |
||
100 | * |
||
101 | * @return \AppserverIo\Collections\ArrayList Returns an ArrayList initialized with the passed array |
||
102 | * @throws \AppserverIo\Lang\ClassCastException Is thrown if the passed object is not an array |
||
103 | */ |
||
104 | public static function fromArray($array) |
||
113 | |||
114 | /** |
||
115 | * This method returns a new ArrayList with the |
||
116 | * items from the passed offset with the passed |
||
117 | * length. |
||
118 | * |
||
119 | * If no length is passed, the section up from |
||
120 | * the offset until the end of the items is |
||
121 | * returned. |
||
122 | * |
||
123 | * @param integer $offset The start of the section |
||
124 | * @param integer $length The length of the section to return |
||
125 | * |
||
126 | * @return \AppserverIo\Collections\ArrayList Holds the ArrayList with the requested elements |
||
127 | */ |
||
128 | public function slice($offset, $length = null) |
||
143 | } |
||
144 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.