This function returns names of all ancestors based on route path

@return array ancestors names
493190
public function ancestorsNames()
    {
        $ancestors = explode('/', array_get($this->route, 'path'));

        if (empty($ancestors)) {
            return null;
        }

        array_pop($ancestors);

        return array_map('ucfirst', $ancestors);
    }
589769
public function getPathInfo() {
    /** @var TokenNode $first */
    $first = $this->firstChild();
    $absolute = $first->getType() === T_NS_SEPARATOR;
    $relative = $first->getType() === T_NAMESPACE;
    $parts = $this->getParts();
    return [
      'absolute' => $absolute,
      'relative' => $relative,
      'qualified' => !$absolute && count($parts) > 1,
      'unqualified' => !$absolute && count($parts) === 1,
      'parts' => $parts,
    ];
  }
1169739
public function getRoutes() : Array {

		$return = array();
		foreach($this->routes as $route) {
			array_push($return, [$route->getPath(), $route->getMethod()]);
		}
		return $return;

	}
995517
public function getRoutes()
    {
        $out = [];
        foreach($this->routes as $route) {
            $out[] = $route;
        }

        foreach ($this->children as $child) {
            foreach ($child->getRoutes() as $route) {
                $out[] = $route;
            }
        }

        return $out;
    }
444474
public function getAncestors($ignoreSelf = false)
    {
        $ancestors = [];

        if (false === $ignoreSelf) {
            $ancestors[$this->name] = $this->appName;
        }

        /** @var $parent Node */
        foreach ($this->parent as $parent) {
            $parentAncenstors = $parent->getAncestors();

            $ancestors = array_merge($parentAncenstors, $ancestors);
        }

        return $ancestors;
    }
643212
public function get_ancestors() {
        global $DB;
        $ancestors = array();
        $ancestorsids = explode('/', trim($this->get('path'), '/'));
        // Drop the root item from the array /0/.
        array_shift($ancestorsids);
        if (!empty($ancestorsids)) {
            list($insql, $params) = $DB->get_in_or_equal($ancestorsids, SQL_PARAMS_NAMED);
            $ancestors = self::get_records_select("id $insql", $params);
        }
        return $ancestors;
    }
764851
public function getRouteDefinitionsDetail()
    {
        $paths = array();
        foreach ($this->getEndpointsInClasses($this->getReader()) as $endpoint) {
            /* @var \Collective\Annotations\Routing\Annotations\MethodEndpoint $endpoint */
            foreach ($endpoint->toRouteDefinitionDetail() as $path) {
                $paths[] = $path;
            }
        }

        return $paths;
    }
564240
public function getParentRouteName()
	{
		$absoluteRoute	= $this->getAbsoluteName();

		$absoluteRoutes	= explode('.', $absoluteRoute);

		if(count($absoluteRoutes) == 1)
			return null;

		array_pop($absoluteRoutes);

		$parentRoute	= implode('.', $absoluteRoutes);
		
		return $parentRoute;
	}
1022447
public function getAllPaths()
    {
        $paths = [];

        foreach ($this as $endpoint) {
            foreach ($endpoint->getPaths() as $path) {
                $paths[] = $path;
            }
        }

        return $paths;
    }
967727
protected function getInternalDomains()
    {
        $internalDomains = [$this->getApplicationDomainRegex()];

        foreach ($this->app['routes'] as $route) {
            if (!is_null($route->domain())) {
                $internalDomains[] = $this->getDomainRegex($route);
            }
        }

        return array_unique($internalDomains);
    }
197520
public function getOriginalPaths()
    {
        if (null === $this->originalReferrerPaths) {
            $this->originalReferrerPaths = [];
            if (self::INITIALIZED_FROM_COLLECTION === $this->initialized) {
                $uow = $this->dm->getUnitOfWork();
                foreach ($this->collection as $referrer) {
                    $this->originalReferrerPaths[] = $uow->getDocumentId($referrer);
                }
            } else {
                $properties = $this->getReferrerProperties();
                foreach ($properties as $property) {
                    $this->originalReferrerPaths[] = $property->getPath();
                }
            }
        }

        return $this->originalReferrerPaths;
    }
1285343
protected function getAllBasenames()
    {
        $path = $this->getPath();

        try {
            $collection = collect($this->files->directories($path));

            $basenames = $collection->map(function ($item, $key) {
                return basename($item);
            });

            return $basenames;
        } catch (\InvalidArgumentException $e) {
            return collect([]);
        }
    }
176401
public function routeScans()
    {
        if ($this->scanEverything) {
            return $this->getAllClasses();
        }

        $classes = $this->scanRoutes;

        // scan the controllers namespace if the flag is set
        if ($this->scanControllers) {
            $classes = array_merge(
              $classes,
              $this->getClassesFromNamespace($this->getAppNamespace().'Http\\Controllers')
            );
        }

        return $classes;
    }
865752
public function findAncestors(ResourceNode $resource)
    {
        // No need to access DB to get ancestors as they are given by the materialized path.
        $regex = '/-(\d+)' . ResourceNode::PATH_SEPARATOR . '/';
        $parts = preg_split($regex, $resource->getPath(), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        $ancestors = array();
        $currentPath = '';

        for ($i = 0, $count = count($parts); $i < $count; $i += 2) {
            $ancestor = array();
            $currentPath = $currentPath . $parts[$i] . '-' . $parts[$i + 1] . '`';
            $ancestor['path'] = $currentPath;
            $ancestor['name'] = $parts[$i];
            $ancestor['id'] = (int) $parts[$i + 1];
            $ancestors[] = $ancestor;
        }

        return $ancestors;
    }
779931
public function ancestor($route, $path = null)
    {
        if ($path !== null) {
            $page = $this->dispatch($route, true);

            if ($page && $page->path() === $path) {
                return $page;
            }

            $parent = $page ? $page->parent() : null;
            if ($parent && !$parent->root()) {
                return $this->ancestor($parent->route(), $path);
            }
        }

        return null;
    }
260445
protected function getInternalDomains()
    {
        $internalDomains = [];

        $routes = $this->grabService('router')->getRouteCollection();
        /* @var \Symfony\Component\Routing\Route $route */
        foreach ($routes as $route) {
            if (!is_null($route->getHost())) {
                $compiled = $route->compile();
                if (!is_null($compiled->getHostRegex())) {
                    $internalDomains[] = $compiled->getHostRegex();
                }
            }
        }

        return array_unique($internalDomains);
    }
1293595
def get_ancestors(self):
        
        ancestors = list(self.get_parents())
        ancestor_unique_attributes = set([(a.__class__, a.id) for a in ancestors])
        ancestors_with_parents = [a for a in ancestors if isinstance(a, DescendantMixin)]
        for ancestor in ancestors_with_parents:
            for parent in ancestor.get_ancestors():
                if (parent.__class__, parent.id) not in ancestor_unique_attributes:
                    ancestors.append(parent)
        return ancestors