src/Di/Container.php
public function get($id)
    {
        if ($this->has($id)) {
            return $this->instances[$id];
        } elseif ($this->hasAlias($id) && $this->has($this->aliases[$id])) {
            return $this->instances[$this->aliases[$id]];
        }

        return $this->create($id);
    }
public function get($id)
    {
        if ($this->has($id)) {
            return $this->instances[$id];
        } elseif ($this->hasAlias($id) && $this->has($this->aliases[$id])) {
            return $this->instances[$this->aliases[$id]];
        }

        return $this->create($id);
    }
public function get ( $ id ) { if ( $ this -> has ( $ id ) ) { return $ this -> instances [ $ id ] ; } elseif ( $ this -> hasAlias ( $ id ) && $ this -> has ( $ this -> aliases [ $ id ] ) ) { return $ this -> instances [ $ this -> aliases [ $ id ] ] ; } return $ this -> create ( $ id ) ; }
Get an instance if exists, otherwise try to create it return null

@param string $id
@return mixed|object
@throws ClassDefinitionNotFoundException
@throws Exception\AmbiguousResolutionException
@throws Exception\InterfaceNotFoundException
@throws \ReflectionException
Get an instance if exists otherwise try to create it return null