Flarum\Foundation\Application::registerDeferredProvider PHP Method

registerDeferredProvider() public method

Register a deferred provider and service.
public registerDeferredProvider ( string $provider, string $service = null )
$provider string
$service string
    public function registerDeferredProvider($provider, $service = null)
    {
        // Once the provider that provides the deferred service has been registered we
        // will remove it from our local list of the deferred services with related
        // providers so that this container does not try to resolve it out again.
        if ($service) {
            unset($this->deferredServices[$service]);
        }
        $this->register($instance = new $provider($this));
        if (!$this->booted) {
            $this->booting(function () use($instance) {
                $this->bootProvider($instance);
            });
        }
    }