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");
		}
	}
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");
		}
	}
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" ) ; } }
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
Registers a dependency for injection