Automattic\WooCommerce\Internal\DependencyManagement
Definition::resolveClass() protected WC 1.0
Resolve a class using method injection instead of constructor injection.
{} Это метод класса: Definition{}
Хуков нет.
Возвращает
Объект.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->resolveClass( $concrete );
- $concrete(строка) (обязательный)
- The concrete to instantiate.
Код Definition::resolveClass() Definition::resolveClass WC 4.9.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;
}