public function bindInjector(string $class, $injector): Container
    {
        if (!is_string($injector)) {
            throw new \InvalidArgumentException('Injector can only be set as string binding');
        }

        $this->injectors[$class] = $injector;

        return $this;
    }
public function bindInjector(string $class, $injector): Container
    {
        if (!is_string($injector)) {
            throw new \InvalidArgumentException('Injector can only be set as string binding');
        }

        $this->injectors[$class] = $injector;

        return $this;
    }
public function bindInjector ( string $ class , $ injector ) : Container { if ( ! is_string ( $ injector ) ) { throw new \ InvalidArgumentException ( 'Injector can only be set as string binding' ) ; } $ this -> injectors [ $ class ] = $ injector ; return $ this ; }
Specify binding which has to be used for class injection.

@param string        $class
@param string|object $injector

@return self
Specify binding which has to be used for class injection .