public function toInstance($instance): self
    {
        if (!($instance instanceof $this->type)) {
            throw new \InvalidArgumentException(
                    'Instance of ' . $this->type . ' expectected, '
                    . get_class($instance) . ' given.'
            );
        }

        $this->instance = $instance;
        return $this;
    }
public function toInstance($instance): self
    {
        if (!($instance instanceof $this->type)) {
            throw new \InvalidArgumentException(
                    'Instance of ' . $this->type . ' expectected, '
                    . get_class($instance) . ' given.'
            );
        }

        $this->instance = $instance;
        return $this;
    }
public function toInstance ( $ instance ) : self { if ( ! ( $ instance instanceof $ this -> type ) ) { throw new \ InvalidArgumentException ( 'Instance of ' . $ this -> type . ' expectected, ' . get_class ( $ instance ) . ' given.' ) ; } $ this -> instance = $ instance ; return $ this ; }
set the concrete instance

This cannot be used in conjuction with the 'toProvider()' or
'toProviderClass()' method.

@api
@param   object  $instance
@return  \stubbles\ioc\binding\ClassBinding
@throws  \InvalidArgumentException
set the concrete instance