Resolve the specified path. If the resulting value is a Closure, it's assumed a declaration and therefore
executed

@param array|string $id
@param bool $required
@return string

@throws \RuntimeException
@throws CircularReferenceException
420105
public function resolve($id, $required = false)
    {
        $id = $this->path($id);

        try {
            if (in_array($id, $this->resolutionStack)) {
                $path = array_map(
                    function ($a) {
                        return join('.', $a);
                    },
                    $this->resolutionStack
                );

                throw new CircularReferenceException(
                    sprintf(
                        "Circular reference detected: %s -> %s",
                        implode(' -> ', $path),
                        join('.', $id)
                    )
                );
            }

            array_push($this->resolutionStack, $id);
            $ret = $this->value($this->lookup($this->values, $id, $required));
            array_pop($this->resolutionStack);
            return $ret;
        } catch (\Exception $e) {
            if ($e instanceof CircularReferenceException) {
                throw $e;
            }
            throw new \RuntimeException("While resolving value " . join(".", $id), 0, $e);
        }
    }
26041
protected function checkCircularMark(/*# string */ $id)
    {
        // reference id "@$id@" of current service object
        $refId = $this->getServiceReferenceId($id);

        // circular detected
        if (isset($this->circular[$refId])) {
            throw new LogicException(
                Message::get(Message::SERVICE_CIRCULAR, $id),
                Message::SERVICE_CIRCULAR
            );

        // mark it
        } else {
            $this->circular[$refId] = ++$this->counter;
        }
    }
1174393
public function make( $id, array $parameters = [] ) {
		if ( ! $this->bound( $id ) ) {
			throw new InvalidArgumentException( sprintf( 'Identifier `%s` is not defined', $id ) );
		}

		$id      = $this->get_class_prefix( $id );
		$value   = $this->bindings[$id];
		$closure = $value['closure'];

		return $this->call_closure( $closure, $parameters );
	}
1111093
protected function call(Container $container, $id, ...$args)
    {
        $ret = $container->resolve($id);

        if (is_array($ret) && $ret[0] instanceof \Closure && is_bool($ret[1])) {
            return ($ret[1]) ? $ret[0]($container, ...$args) : $ret[0](...$args);
        }

        return null;
    }
1294426
public function renderByIdAction($id, $path = '')
    {
        /**
         * @var PageInterface $page
         */
        $page = $this
            ->pageRepository
            ->findOneById($id);

        return $this
            ->pageResponseTransformer
            ->createResponseFromPage(
                $page,
                $path
            );
    }
846025
protected function getPathForSessionId($id)
    {
        if (is_null($this->path)) {
            throw new Exception("Path not set");
        }

        return sprintf('%s/%s%s', $this->path, $this->prefix, $id);
    }
1267320
public function resolveContactFunction($id)
    {
        if ($this->cache->contains($id)) {
            return $this->cache->fetch($id);
        }

        $contact = $this->contactRepository->find($id);
        if (null === $contact) {
            return;
        }

        $this->cache->save($id, $contact);

        return $contact;
    }
3368
function toAbsolute(id) {
    return id.startsWith("./") ? path.resolve(id) : require.resolve(id)
}
1038282
private function findEdges($id, array $arguments, $required, $name)
    {
        $edges = array();
        foreach ($arguments as $argument) {
            if ($argument instanceof Parameter) {
                $argument = $this->container->hasParameter($argument) ? $this->container->getParameter($argument) : null;
            } elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) {
                $argument = $this->container->hasParameter($match[1]) ? $this->container->getParameter($match[1]) : null;
            }

            if ($argument instanceof Reference) {
                if (!$this->container->has((string) $argument)) {
                    $this->nodes[(string) $argument] = array('name' => $name, 'required' => $required, 'class' => '', 'attributes' => $this->options['node.missing']);
                }

                $edges[] = array('name' => $name, 'required' => $required, 'to' => $argument);
            } elseif (is_array($argument)) {
                $edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name));
            }
        }

        return $edges;
    }
1015622
public function path($id = null)
	{
		if (! isset($this->resource_path)) {
			throw new \InvalidArgumentException(static::class . ' does not implement a resource path definition.');
		}

		return is_null($id) ? $this->url($this->resource_path) : $this->url("$this->resource_path/$id");
	}
836040
private function resolveValidPath():string{
		$last = null;
		foreach( $this->tree as $level ){
			if( !$level->exist ){
				break;
			}
			$last = $level;
		}
		if( $last === null ){
			return '';
		}
		return $last->path;
	}
1092820
protected function dereference($id): string
    {
        if ($id instanceof Reference) {
            $id = $id->getId();
        }

        if (!isset($this->definitions[$id]) || !$this->definitions[$id] instanceof Reference) {
            return $id;
        }

        if (isset($this->dereferencing[$id])) {
            throw new CircularReferenceException(sprintf(
                'Circular reference to "%s" detected while dereferencing: %s; building: %s',
                $id,
                implode(',', array_keys($this->dereferencing)),
                implode(',', array_keys($this->building))
            ));
        }

        $this->dereferencing[$id] = 1;
        $newId = $this->dereference($this->definitions[$id]->getId());
        unset($this->dereferencing[$id]);

        return $newId;
    }
341341
public function getRequest($id)
    {
        if (!isset($this->request[$id])) {
            return null;
        }

        return $this->request[$id];
    }
839025
protected function resolving(string $id)
    {
        if (isset($this->resolving[$id])) {
            throw new CircularReferenceException($id, $this->resolving);
        }

        // We mark service as being resolved to detect circular references through out the resolution chain.
        $this->resolving[$id] = $id;
    }
527769
public static function markResolved($id) {
		$db = Factory::getDBO();

		$query = $db->getQuery(true)
			->update('#__jfusion_sync_details')
			->set('action = ' . $db->quote('resolved'))
			->where('id = ' . $db->quote($id));

		$db->setQuery($query);
		$db->execute();
	}
437395
public function lookup($context, $path, $require = false)
    {
        if (empty($path)) {
            throw new \InvalidArgumentException("Passed lookup path is empty.");
        }
        if (empty($context)) {
            throw new \InvalidArgumentException("Specified context is empty while resolving path " . json_encode($path));
        }
        return PropertyAccessor::getByPath($context, $this->path($path), $require);
    }
1370658
public function getDependencies($id)
    {
        return (isset($this->dependenciesById[$id])) ?
            $this->dependenciesById[$id] :
            null;
    }