src/ParametricTree/RecursiveTree.php
protected function injectInCrown(RecursiveLeafInterface $leaf, $uniqueKey = null)
    {
        if (is_null($uniqueKey)) {
            $this->crown[] = null;

            $uniqueKey = key(array_slice($this->crown, -1, 1, true));
        }
        $leaf->setUniqueKey($uniqueKey);
        $this->crown[$uniqueKey] = $leaf;
    }
protected function injectInCrown(RecursiveLeafInterface $leaf, $uniqueKey = null)
    {
        if (is_null($uniqueKey)) {
            $this->crown[] = null;

            $uniqueKey = key(array_slice($this->crown, -1, 1, true));
        }
        $leaf->setUniqueKey($uniqueKey);
        $this->crown[$uniqueKey] = $leaf;
    }
protected function injectInCrown ( RecursiveLeafInterface $ leaf , $ uniqueKey = null ) { if ( is_null ( $ uniqueKey ) ) { $ this -> crown [ ] = null ; $ uniqueKey = key ( array_slice ( $ this -> crown , - 1 , 1 , true ) ) ; } $ leaf -> setUniqueKey ( $ uniqueKey ) ; $ this -> crown [ $ uniqueKey ] = $ leaf ; }
Injects leaf in crown of the tree.

@param RecursiveLeafInterface $leaf      The leaf
@param int|string             $uniqueKey The unique key of leaf
Injects leaf in crown of the tree .