public function register($id, $definition, $shared = false)
    {
        if (is_object($definition) && !is_callable($definition)) {
            $this->instances[$id] = $definition;

            return $this;
        }

        $this->components[$id] = $definition;

        if ($shared || isset($this->instances[$id])) {
            $this->instances[$id] = null;
        }

        return $this;
    }
public function register($id, $definition, $shared = false)
    {
        if (is_object($definition) && !is_callable($definition)) {
            $this->instances[$id] = $definition;

            return $this;
        }

        $this->components[$id] = $definition;

        if ($shared || isset($this->instances[$id])) {
            $this->instances[$id] = null;
        }

        return $this;
    }
public function register ( $ id , $ definition , $ shared = false ) { if ( is_object ( $ definition ) && ! is_callable ( $ definition ) ) { $ this -> instances [ $ id ] = $ definition ; return $ this ; } $ this -> components [ $ id ] = $ definition ; if ( $ shared || isset ( $ this -> instances [ $ id ] ) ) { $ this -> instances [ $ id ] = null ; } return $ this ; }
Registers component definition in container

@param string $id
@param mixed  $definition
@param bool   $shared

@return $this
@throws ContainerException
Registers component definition in container