private function resetDynamicSettings()
    {
        // Ensure to reset services that need to be.
        foreach ($this->resettableServiceIds as $serviceId) {
            if (!$this->container->initialized($serviceId)) {
                continue;
            }

            $this->container->set($serviceId, null);
        }

        // Update services that can be updated.
        foreach ($this->updatableServices as $serviceId => $methodCalls) {
            if (!$this->container->initialized($serviceId)) {
                continue;
            }

            $service = $this->container->get($serviceId);
            foreach ($methodCalls as $callConfig) {
                list($method, $expression) = $callConfig;
                $argument = $this->expressionLanguage->evaluate($expression, ['container' => $this->container]);
                call_user_func_array([$service, $method], [$argument]);
            }
        }
    }