original_string: public function offsetSet($class, $factory)
  	{
  		if (is_callable($factory)) {
  			$this->factories[$class] = $factory;
  		} else if (is_object($factory)) {
  			$this->instances[$class] = $factory;
  		} else {
  			throw new \InvalidArgumentException("Dependency supplied is neither a callable or an object");
  		}
  	}
code: public function offsetSet($class, $factory)
  	{
  		if (is_callable($factory)) {
  			$this->factories[$class] = $factory;
  		} else if (is_object($factory)) {
  			$this->instances[$class] = $factory;
  		} else {
  			throw new \InvalidArgumentException("Dependency supplied is neither a callable or an object");
  		}
  	}
code_tokens: public function offsetSet ( $ class , $ factory ) { if ( is_callable ( $ factory ) ) { $ this -> factories [ $ class ] = $ factory ; } else if ( is_object ( $ factory ) ) { $ this -> instances [ $ class ] = $ factory ; } else { throw new \ InvalidArgumentException ( "Dependency supplied is neither a callable or an object" ) ; } }
docstring: Registers a dependency for injection
  
  @throws \InvalidArgumentException
  
  @param $class string
  The class to register
  
  @param $factory mixed A callable or object
  The factory used to create the dependency or the instance of the dependency
docstring_tokens: Registers a dependency for injection