protected function resolveOptions($config)
    {
        if (! $this->schema) {
            return $config;
        }

        try {
            $resolver = new OptionsResolver();
            if ($this->configureOptions($resolver)) {
                $config = $resolver->resolve($config);
            }
        } catch (Exception $exception) {
            throw new FailedToResolveConfigException(
                sprintf(
                    _('Error while resolving config options: %1$s'),
                    $exception->getMessage()
                )
            );
        }

        return $config;
    }