WordPress at Your Fingertips
function is not described


Definition::resolveClass() protected WC 1.0

Resolve a class using method injection instead of constructor injection.

{} It's a method of the class: Definition{}

No Hooks.




// protected - for code of main (parent) or child class
$result = $this->resolveClass( $concrete );
$concrete(string) (required)
The concrete to instantiate.

Code of Definition::resolveClass() WC 5.6.0

protected function resolveClass( string $concrete ) {
	$resolved = $this->resolveArguments( $this->arguments );
	$concrete = new $concrete();

	// Constructor injection causes backwards compatibility problems
	// so we will rely on method injection via an internal method.
	if ( method_exists( $concrete, static::INJECTION_METHOD ) ) {
		call_user_func_array( array( $concrete, static::INJECTION_METHOD ), $resolved );

	return $concrete;