Code Duplication    Length = 6-7 lines in 3 locations

DataStructures/Lists/DoublyLinkedList.php 1 location

@@ 30-36 (lines=7) @@
27
    private $position;
28
    private $current;
29
30
    public function __construct() {
31
        $this->head = null;
32
        $this->tail = &$this->head;
33
        $this->size = 0;
34
        $this->position = 0;
35
        $this->current = &$this->head;
36
    }
37
38
    /**
39
     * Removes all nodes of the list. It removes from the beginning.

DataStructures/Lists/SimpleLinkedList.php 1 location

@@ 30-35 (lines=6) @@
27
    private $position;
28
    private $current;
29
30
    public function __construct() {
31
        $this->head = null;
32
        $this->size = 0;
33
        $this->position = 0;
34
        $this->current = &$this->head;
35
    }
36
37
    /**
38
     * Returns the list size.

DataStructures/Lists/CircularLinkedList.php 1 location

@@ 33-39 (lines=7) @@
30
    private $current;
31
    private $position;
32
33
    public function __construct() {
34
        $this->head = null;
35
        $this->tail = &$this->head;
36
        $this->size = 0;
37
        $this->position = 0;
38
        $this->current = &$this->head;
39
    }
40
41
    /**
42
     * Returns the list size.