src/Container/Container.php
public function attach($id, $instance)
    {
        if ($this->has($id)) {
            return $this;
        }

        $this->instances[$id] = $instance;

        return $this;
    }
public function attach($id, $instance)
    {
        if ($this->has($id)) {
            return $this;
        }

        $this->instances[$id] = $instance;

        return $this;
    }
public function attach ( $ id , $ instance ) { if ( $ this -> has ( $ id ) ) { return $ this ; } $ this -> instances [ $ id ] = $ instance ; return $ this ; }
Attach new instance of any class to this container.
If already exists, does not attach the new instance.

@param  string $id Key name to retrieve the instance
@param  object $instance Instance to attach
@param  string $type Type of object
@return self
@throws \LogicException
Attach new instance of any class to this container . If already exists does not attach the new instance .