src/Datastructure/Lists/Node.php
public function size() {
        /** @var Node $node */
        $node = $this->next;
        $size = 1;

        while ($node !== null) {
            $size++;
            $node = $node->getNext();
        }
        return $size;
    }
public function size() {
        /** @var Node $node */
        $node = $this->next;
        $size = 1;

        while ($node !== null) {
            $size++;
            $node = $node->getNext();
        }
        return $size;
    }
public function size ( ) { /** @var Node $node */ $ node = $ this -> next ; $ size = 1 ; while ( $ node !== null ) { $ size ++ ; $ node = $ node -> getNext ( ) ; } return $ size ; }
counts the number of nodes

@return int
counts the number of nodes