protected function build( $concrete, array $parameters = [] ) {

		if ( $concrete instanceof Closure ) {
			return $concrete( $this, $parameters );
		}

		$reflect = new ReflectionClass( $concrete );

		$constructor = $reflect->getConstructor();

		if ( ! $constructor ) {
			return new $concrete();
		}

		return $reflect->newInstanceArgs(
			$this->resolveDependencies( $constructor->getParameters(), $parameters )
		);
	}
protected function build( $concrete, array $parameters = [] ) {

		if ( $concrete instanceof Closure ) {
			return $concrete( $this, $parameters );
		}

		$reflect = new ReflectionClass( $concrete );

		$constructor = $reflect->getConstructor();

		if ( ! $constructor ) {
			return new $concrete();
		}

		return $reflect->newInstanceArgs(
			$this->resolveDependencies( $constructor->getParameters(), $parameters )
		);
	}
protected function build ( $ concrete , array $ parameters = [ ] ) { if ( $ concrete instanceof Closure ) { return $ concrete ( $ this , $ parameters ) ; } $ reflect = new ReflectionClass ( $ concrete ) ; $ constructor = $ reflect -> getConstructor ( ) ; if ( ! $ constructor ) { return new $ concrete ( ) ; } return $ reflect -> newInstanceArgs ( $ this -> resolveDependencies ( $ constructor -> getParameters ( ) , $ parameters ) ) ; }
Builds the concrete implementation. If a closure, we'll simply return
the closure and pass the included parameters. Otherwise, we'll resolve
the dependencies for the class and return a new object.

@since  5.0.0
@access protected
@param  mixed  $concrete
@param  array  $parameters
@return object
Builds the concrete implementation . If a closure we ll simply return the closure and pass the included parameters . Otherwise we ll resolve the dependencies for the class and return a new object .