# double-opt-in/5.6.3/src/Providers/FormSettingsServiceProvider.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 5.6.3. 88 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/5.6.3/code/src/Providers/FormSettingsServiceProvider.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/5.6.3/raw/src/Providers/FormSettingsServiceProvider.php
- Modified: 2026-07-13T09:16:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/double-opt-in/5.6.3/code/src/Providers/FormSettingsServiceProvider.php#L10-L20`.

```php
<?php
/**
 * Form Settings Service Provider
 *
 * @package Forge12\DoubleOptIn\Providers
 * @since   4.1.0
 */

namespace Forge12\DoubleOptIn\Providers;

use Forge12\DoubleOptIn\Admin\FormSettingsController;
use Forge12\DoubleOptIn\Container\BootableProviderInterface;
use Forge12\DoubleOptIn\Container\Container;
use Forge12\DoubleOptIn\FormSettings\FormSettingsDTO;
use Forge12\DoubleOptIn\FormSettings\FormSettingsService;
use Forge12\DoubleOptIn\FormSettings\FormSettingsValidator;
use Forge12\DoubleOptIn\Integration\FormIntegrationRegistry;
use Forge12\Shared\LoggerInterface;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class FormSettingsServiceProvider
 *
 * Registers form settings services in the DI container.
 */
class FormSettingsServiceProvider implements BootableProviderInterface {

	/**
	 * Register services in the container.
	 *
	 * @param Container $container The DI container.
	 *
	 * @return void
	 */
	public function register( Container $container ): void {
		// Register validator as singleton
		$container->singleton(
			FormSettingsValidator::class,
			function () {
				return new FormSettingsValidator();
			}
		);

		// Register service as singleton
		$container->singleton(
			FormSettingsService::class,
			function ( Container $c ) {
				return new FormSettingsService(
					$c->get( LoggerInterface::class ),
					FormIntegrationRegistry::getInstance(),
					$c->get( FormSettingsValidator::class )
				);
			}
		);

		// Register controller as singleton
		$container->singleton(
			FormSettingsController::class,
			function ( Container $c ) {
				return new FormSettingsController(
					$c->get( LoggerInterface::class ),
					$c->get( FormSettingsService::class ),
					$c->get( FormSettingsValidator::class )
				);
			}
		);
	}

	/**
	 * Boot services.
	 *
	 * @param Container $container The DI container.
	 *
	 * @return void
	 */
	public function boot( Container $container ): void {
		// Register AJAX actions
		$controller = $container->get( FormSettingsController::class );
		$controller->registerActions();

		// The forms admin screen is the React SPA (AdminPageController), which
		// consumes this controller's REST routes.
	}
}

```
