src/Container.php
private function getRecursive(string $name) {
        if ($name === self::SELF_NAME) {
            return $this;
        }
        if (!isset($this->services[$name])) {
            if (in_array($name, $this->usedNames)) {
                throw new Exception("Cyclic dependency found while resolving $name");
            }
            $this->usedNames[] = $name;
            if (!isset($this->initializers[$name])) {
                throw new Exception("No initializer for $name");
            }
            $this->services[$name] = $this->produceRecursive($this->initializers[$name]);
        }
        return $this->services[$name];
    }
private function getRecursive(string $name) {
        if ($name === self::SELF_NAME) {
            return $this;
        }
        if (!isset($this->services[$name])) {
            if (in_array($name, $this->usedNames)) {
                throw new Exception("Cyclic dependency found while resolving $name");
            }
            $this->usedNames[] = $name;
            if (!isset($this->initializers[$name])) {
                throw new Exception("No initializer for $name");
            }
            $this->services[$name] = $this->produceRecursive($this->initializers[$name]);
        }
        return $this->services[$name];
    }
private function getRecursive ( string $ name ) { if ( $ name === self :: SELF_NAME ) { return $ this ; } if ( ! isset ( $ this -> services [ $ name ] ) ) { if ( in_array ( $ name , $ this -> usedNames ) ) { throw new Exception ( "Cyclic dependency found while resolving $name" ) ; } $ this -> usedNames [ ] = $ name ; if ( ! isset ( $ this -> initializers [ $ name ] ) ) { throw new Exception ( "No initializer for $name" ) ; } $ this -> services [ $ name ] = $ this -> produceRecursive ( $ this -> initializers [ $ name ] ) ; } return $ this -> services [ $ name ] ; }
Return an initialized service.

@param $name string
@return mixed
Return an initialized service .