Automattic\WooCommerce\Internal\DependencyManagement

ExtendedContainer::get_class_from_concrete()protectedWC 1.0

Gets the class from the concrete regardless of type.

Метод класса: ExtendedContainer{}

Хуков нет.

Возвращает

Строку|null. The class from the concrete if one is available, null otherwise.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_class_from_concrete( $concrete );
$concrete(разное) (обязательный)
The concrete that we want the class from..

Код ExtendedContainer::get_class_from_concrete() WC 8.7.0

protected function get_class_from_concrete( $concrete ) {
	if ( is_object( $concrete ) && ! is_callable( $concrete ) ) {
		if ( $concrete instanceof DefinitionInterface ) {
			return $this->get_class_from_concrete( $concrete->getConcrete() );
		}

		return get_class( $concrete );
	}

	if ( is_string( $concrete ) && class_exists( $concrete ) ) {
		return $concrete;
	}

	return null;
}