public function register($name, $instance)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException(sprintf(
                'Argument #1 $name must be a string, received "%s"', gettype($name)
            ));
        }

        $this->container[$name] = $instance;
        return $this;
    }
public function register($name, $instance)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException(sprintf(
                'Argument #1 $name must be a string, received "%s"', gettype($name)
            ));
        }

        $this->container[$name] = $instance;
        return $this;
    }
public function register ( $ name , $ instance ) { if ( ! is_string ( $ name ) ) { throw new InvalidArgumentException ( sprintf ( 'Argument #1 $name must be a string, received "%s"' , gettype ( $ name ) ) ) ; } $ this -> container [ $ name ] = $ instance ; return $ this ; }
Registers a new service

@param string $name
@param object $instance
@throws \InvalidArgumentException if service name isn't string
@return \Krystal\InstanceManager\ServiceLocator
Registers a new service