{@inheritdoc}

@psalm-param T $root

@psalm-return array<int, T>
324759
public function RecallDaftNestedObjectTreeWithObject(
        DaftNestedObject $root,
        bool $includeRoot,
        ? int $limit
    ) : array {
        $left = $root->GetIntNestedLeft();
        $right = $root->GetIntNestedRight();
        $limit = is_int($limit) ? ($root->GetIntNestedLevel() + $limit) : null;

        $leaves = $this->RecallDaftNestedObjectFullTree();

        if (is_int($limit)) {
            $leaves = array_filter($leaves, function (DaftNestedObject $e) use ($limit) : bool {
                return $e->GetIntNestedLevel() <= $limit;
            });
        }

        return array_values(array_filter(
            $leaves,
            /**
            * @psalm-param T $e
            */
            function (DaftNestedObject $e) use ($includeRoot, $left, $right) : bool {
                return $this->FilterLeaf($includeRoot, $left, $right, $e);
            }
        ));
    }
322459
static public function arr2xml($data, $root = 'xml', $item = 'item', $id = 'id')
    {
        return "<{$root}>" . self::_data_to_xml($data, $item, $id) . "</{$root}>";
    }
1024214
public static function getDI($root, array $options)
    {
        $class = $options['class'] ?: '';
        if (!$class) {
            return null;
        }

        $cacheDisabled = getenv(static::ENV_CACHE_DISABLED);
        if ($cacheDisabled) {
            return self::buildContainer($root, $class, $options);
        }

        return self::getCachedContainer($class);
    }
1046374
public function type($name, &$root)
    {
        while (substr($name, -2) == '[]') {
            $this->_dimension++;
            $name = substr($name, 0, -2);
        }
        $this->_name = $name;
        $this->_root =& $root;
    }
826961
public static function arrayToXml($arr, $root='xml', $num=0){
        $xml = '';
        if(!$num){
            $num += 1;
            $xml .= '<?xml version="1.0" encoding="utf-8"?>';
        }
        $xml .= "<$root>";
        foreach ($arr as $key=>$val){
            if(is_array($val) || is_object($val)){
                $xml.=self::arrayToXml($val,"$key",$num);
            } else {
                $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
            }
        }
        $xml .="</$root>";
        return $xml;
    }
144462
protected function getOptions($root = null)
    {
        $_SERVER['DOCUMENT_ROOT'] .= $this->getBaseUrl();

        if ($root) {
            $_SERVER['DOCUMENT_ROOT'] .= $root;
        }

        return array(
            // Output an array of data instead of returning headers/content.
            'quiet' => true,

            // In debug mode, allow access to all files, in case assets are symlinked to Bower repos for example.
            'minApp' => array('allowDirs' =>  $this->get('kernel')->isDebug() ? array('/') : array(
                // Allow all files inside the Symfony root folder to be accessed, in case asset files are symlinked to it.
                __DIR__ . '/../../../../../../',

                // Allow files in the configured combo-root to be accessed.
                $_SERVER['DOCUMENT_ROOT']
            )),

            // CSS URIs are rewritten. Don't minify JavaScript, we're just providing a combo service.
            'minifiers' => array(
                \Minify::TYPE_CSS => array('Rednose\ComboHandlerBundle\Controller\MinifyController', 'rewriteUris'),
                \Minify::TYPE_JS  => '',
            ),

            'minifierOptions' => array(
                \Minify::TYPE_CSS => array('baseUrl' => $this->getBaseUrl().$root)
            )
        );
    }
97530
public function getSet($root)
    {
        $filters = $this->getQueryFilters();
        $filters['where'] = array($this->_child_key => $root);

        $options = array(
            'repository' => $this->getChildRepository(),
            'query' => $filters,
            'root' => $root,
            'property' => $this->_child_key,
        );

        $set = AnService::get('anahita:domain.entityset.decorator.onetomany', $options);

        return $set;
    }
69483
public static function fetch($path, $root) {
      $_ = (array)$root;
      if (strpos($path,'.') === false) {
        return isset($_[$path]) ? $_[$path] : null;
      } else {
        list($frag,$rest) = explode('.', $path, 2);
        if ($rest) {
          return isset($_[$frag]) ? self::fetch($rest, $_[$frag]) : null;
        } elseif ($frag) {
          return (array)$_[$frag];
        } else {
          return null;
        }
      }
    }
783936
public function build(RootNode &$root)
    {
        $parser = new RoutingRuleParser($this->routing_rule);
        
        try{
            $section_list_set = $parser->parse();
        }
        catch(RoutingRuleParseException $e){
            throw new RouterNodeBuilderException($this->routing_rule, 'Parse failed');
        }
        
        $node = $root;
        
        foreach($section_list_set as $section_list){
            while(($section = array_shift($section_list))!==null) {
                $last = empty($section_list);
                if (is_string($section)){
                    if ($last){
                        $node->leaf($section)->bind($this->filter, $this->event);
                        break;
                    }
                    $node = $node->node($section);
                }
                else if (is_array($section)){
                    $varname = $section['varname'] ?? null;
                    $regex = $section['regex'] ?? null;
                    $type = $section['type'] ?? null;
                    $regex = empty($regex) ? '.*' : $regex;
                    if ($last){
                        $node->leaf($regex,$varname,$type)->bind($this->filter, $this->event);
                        break;
                    }
                    $node = $node->node($regex,$varname,$type);
                }
                else if ($section instanceof EmptyRoutingPathInterface){
                    if ($last){
                        $node->leaf('()')->bind($this->filter, $this->event);
                        break;
                    }
                    throw new RouterNodeBuilderException($this->routing_rule, 'Empty section not allowed before last section');
                }
                else{
                    throw new RouterNodeBuilderException($this->routing_rule, 'invalid section');
                }
            }
        }
    }
1002752
public static function listDirsRecusrive($root)
    {
        $dirs = [];
        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($root, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $path) {
            if ($path->isDir()) {
                $dirs[] = $path->getPathname();
            }
        }
        return $dirs;
    }
545622
public static function set(array $root, string $key, $val){
        $origin = $root;
        $node   = &$root;

        foreach(explode(".", $key) as $key){
            if(!is_array($key) || !array_key_exists($key, $node)){
                return $origin;
            }

            $node   = &$node[$key];
        }

        $node   = $val;

        return $root;
    }
60389
public function whereRootIn(array $roots)
    {
        if (0 !== $count = count($roots)) {
            $eol = PHP_EOL;
            $clause = "{$eol}({$eol}";

            for ($i = 0; $i < $count; $i++) {
                $clause .= $i > 0 ? '    OR ' : '    ';
                $clause .= "node.path LIKE :root_{$i}{$eol}";
                $this->parameters[":root_{$i}"] = "{$roots[$i]}_%";
            }

            $this->addWhereClause($clause . ')');
        }

        return $this;
    }
63421
protected function resolveCallbacksForRoots(array $roots)
    {
        foreach ($roots as $i => $root) {
            $roots[$i] = $this->resolveCallbacksForRoot($root);
        }

        return $roots;
    }
466565
protected function makeUriRelativeTo($uri, $root)
    {
        if (!$root) {
            return $uri;
        }

        if (is_array($uri)) {
            $uris = [];
            foreach ($uri as $u) {
                $uris[] = $this->makeUriRelativeTo($u, $root);
            }
            return $uris;
        }

        if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
            return $uri;
        }
        return rtrim($root, '/') . "/$uri";
    }
1182764
public static function get(array $root, string $key){
        $nodes  = self::getMatchedNodes($root, $key);

        if(empty($nodes)){
            return null;
        }else if(count($nodes) === 1){
            return array_pop($nodes);
        }

        return $nodes;
    }
596682
public function get($root, $path)
	{
		$url = $root . $path;

		$response = Http::get($url . $this->countryCode . $this->localLang);

		if (is_array($response)) {

			return $response;
		} else {

			return false;
		}
	}
697047
public function value($root, $path)
    {
        if (!is_array($root) && !is_object($root)) {
            return null;
        }

        if (!$this->isNestedKey($path)) {
            return $this->getNode($root, $path);
        }

        return $this->getNestedValue($root, $path);
    }