src/Container.php
public function getNewInstance($class) {
		if (isset($this->aliases[$class])) {
			$class = $this->aliases[$class];
		}

		$args = $this->resolveArgs($class, '__construct', " when constructing $class");
		if ($args) {
			$instance = new $class(...$args);
		} else {
			$instance = new $class;
		}

		return $instance;
	}
public function getNewInstance($class) {
		if (isset($this->aliases[$class])) {
			$class = $this->aliases[$class];
		}

		$args = $this->resolveArgs($class, '__construct', " when constructing $class");
		if ($args) {
			$instance = new $class(...$args);
		} else {
			$instance = new $class;
		}

		return $instance;
	}
public function getNewInstance ( $ class ) { if ( isset ( $ this -> aliases [ $ class ] ) ) { $ class = $ this -> aliases [ $ class ] ; } $ args = $ this -> resolveArgs ( $ class , '__construct' , " when constructing $class" ) ; if ( $ args ) { $ instance = new $ class ( ... $ args ) ; } else { $ instance = new $ class ; } return $ instance ; }
Construct an new instance of a class with its dependencies.

@param string $class
@return object
Construct an new instance of a class with its dependencies .