Code Duplication    Length = 8-8 lines in 3 locations

DataStructures/Lists/DoublyLinkedList.php 1 location

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

DataStructures/Lists/SimpleLinkedList.php 1 location

@@ 46-53 (lines=8) @@
43
     * @return mixed The data stored in the given index
44
     * @throws OutOfBoundsException if index is out bounds.
45
     */
46
    public function get($index) {
47
        $node = $this->search($index);
48
        if($node === null) {
49
            return null;
50
        }
51
52
        return $node->data;
53
    }
54
55
    /**
56
     * Returns the node stored in the given position.

DataStructures/Lists/CircularLinkedList.php 1 location

@@ 124-131 (lines=8) @@
121
     * @throws OutOfBoundsException if it is out of limits (< 0 or > size - 1)
122
     * @return mixed the data stored in $index node.
123
     */
124
    public function get($index) {
125
        $node = $this->search($index);
126
        if($node === null) {
127
            return null;
128
        }
129
130
        return $node->data;
131
    }
132
133
    /**
134
     * Returns the node stored in the given position.