Automattic\WooCommerce\Vendor\League\Container\ServiceProvider

ServiceProviderAggregate::register()publicWC 1.0

{@inheritdoc}

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ServiceProviderAggregate = new ServiceProviderAggregate();
$ServiceProviderAggregate->register( $service );
$service(строка) (обязательный)
-

Код ServiceProviderAggregate::register() WC 8.7.0

public function register(string $service)
{
    if (false === $this->provides($service)) {
        throw new ContainerException(
            sprintf('(%s) is not provided by a service provider', $service)
        );
    }

    foreach ($this->getIterator() as $provider) {
        if (in_array($provider->getIdentifier(), $this->registered, true)) {
            continue;
        }

        if ($provider->provides($service)) {
            $this->registered[] = $provider->getIdentifier();
            $provider->register();
        }
    }
}