Code Duplication    Length = 8-8 lines in 3 locations

DataStructures/Lists/CircularLinkedList.php 1 location

@@ 166-173 (lines=8) @@
163
     * @throws OutOfBoundsException if it is out of limits (< 0 or > size - 1)
164
     * @return mixed the data stored in $index node.
165
     */
166
    public function get($index) {
167
        $node = $this->search($index);
168
        if($node === null) {
169
            return null;
170
        }
171
172
        return $node->data;
173
    }
174
175
    /**
176
     * Returns the node stored in the given position.

DataStructures/Lists/DoublyLinkedList.php 1 location

@@ 59-66 (lines=8) @@
56
     * @return mixed The data stored in the given index
57
     * @throws OutOfBoundsException if index is out bounds.
58
     */
59
    public function get($index) {
60
        $node = $this->search($index);
61
        if($node === null) {
62
            return null;
63
        }
64
65
        return $node->data;
66
    }
67
68
    /**
69
     * Gets the node stored in the position especified.

DataStructures/Lists/SimpleLinkedList.php 1 location

@@ 70-77 (lines=8) @@
67
     * @return mixed The data stored in the given index
68
     * @throws OutOfBoundsException if index is out bounds.
69
     */
70
    public function get($index) {
71
        $node = $this->search($index);
72
        if($node === null) {
73
            return null;
74
        }
75
76
        return $node->data;
77
    }
78
79
    /**
80
     * Returns the node stored in the given position.