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);
        }
    }
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);
        }
    }
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 ) ; } }
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
Resolve the specified path . If the resulting value is a Closure it s assumed a declaration and therefore executed