Yoast\WP\Lib\Dependency_Injection

Container_Registry::find()public staticYoast 1.0

Attempts to find a given service ID in all registered containers.

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

Хуков нет.

Возвращает

Строку|null. The name of the container if the service was found.

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

$result = Container_Registry::find( $id );
$id(строка) (обязательный)
The service ID.

Код Container_Registry::find() Yoast 22.4

public static function find( $id ) {
	foreach ( self::$containers as $name => $container ) {
		if ( $container->has( $id ) ) {
			return $name;
		}
	}
}