src/DI/Definition.php
public function resolve()
    {
        $instance = null;

        $args = [];

        if (isset($this->concrete)) {

            $reflected_class = new \ReflectionClass($this->concrete);

        } else {

            throw new ResolveException;
        }

        $reflected_method = $reflected_class->getConstructor();

        if ($reflected_method) {
            $args = $this->resolveArgs($reflected_method, $this->args);
        }

        $instance = $reflected_class->newInstanceArgs($args);

        foreach ($this->afters as $after) {

            $after($instance);
        }

        return $instance;
    }
public function resolve()
    {
        $instance = null;

        $args = [];

        if (isset($this->concrete)) {

            $reflected_class = new \ReflectionClass($this->concrete);

        } else {

            throw new ResolveException;
        }

        $reflected_method = $reflected_class->getConstructor();

        if ($reflected_method) {
            $args = $this->resolveArgs($reflected_method, $this->args);
        }

        $instance = $reflected_class->newInstanceArgs($args);

        foreach ($this->afters as $after) {

            $after($instance);
        }

        return $instance;
    }
public function resolve ( ) { $ instance = null ; $ args = [ ] ; if ( isset ( $ this -> concrete ) ) { $ reflected_class = new \ ReflectionClass ( $ this -> concrete ) ; } else { throw new ResolveException ; } $ reflected_method = $ reflected_class -> getConstructor ( ) ; if ( $ reflected_method ) { $ args = $ this -> resolveArgs ( $ reflected_method , $ this -> args ) ; } $ instance = $ reflected_class -> newInstanceArgs ( $ args ) ; foreach ( $ this -> afters as $ after ) { $ after ( $ instance ) ; } return $ instance ; }
Resolves the definition

@throws DefinitionException If a class has not yet been set.
@return object
Resolves the definition