protected function _nodesAtDepth(int $i): array
    {
        if (!$this->_root) {
            return array();
        }
        $depth = 0;
        $nodes = array($this->_root);
        while ($depth < $i) {
            $nodes = self::_gatherChildren(...$nodes);
            if (!count($nodes)) {
                break;
            }
            ++$depth;
        }
        return $nodes;
    }
protected function _nodesAtDepth(int $i): array
    {
        if (!$this->_root) {
            return array();
        }
        $depth = 0;
        $nodes = array($this->_root);
        while ($depth < $i) {
            $nodes = self::_gatherChildren(...$nodes);
            if (!count($nodes)) {
                break;
            }
            ++$depth;
        }
        return $nodes;
    }
protected function _nodesAtDepth ( int $ i ) : array { if ( ! $ this -> _root ) { return array ( ) ; } $ depth = 0 ; $ nodes = array ( $ this -> _root ) ; while ( $ depth < $ i ) { $ nodes = self :: _gatherChildren ( ... $ nodes ) ; if ( ! count ( $ nodes ) ) { break ; } ++ $ depth ; } return $ nodes ; }
Get all nodes at given depth.

@param int $i
@return PolicyNode[]
Get all nodes at given depth .