PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.5.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.5.0
5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 3.0.70 3.0.71 3.0.72 3.1.0 All 34 releases
double-opt-in / src / Providers / GdprServiceProvider.php

GdprServiceProvider.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 5.5.0, at src/Providers/GdprServiceProvider.php

65 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * GDPR Service Provider
4 *
5 * @package Forge12\DoubleOptIn\Providers
6 * @since 3.2.0
7 */
8
9 namespace Forge12\DoubleOptIn\Providers;
10
11 use Forge12\DoubleOptIn\Admin\SingleConsentExportController;
12 use Forge12\DoubleOptIn\Container\BootableProviderInterface;
13 use Forge12\DoubleOptIn\Container\Container;
14 use Forge12\DoubleOptIn\Repository\OptInRepositoryInterface;
15 use Forge12\DoubleOptIn\Service\PrivacyIntegration;
16 use Forge12\Shared\LoggerInterface;
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit;
20 }
21
22 /**
23 * Class GdprServiceProvider
24 *
25 * Registers all GDPR-related services in the DI container.
26 */
27 class GdprServiceProvider implements BootableProviderInterface {
28
29 /**
30 * {@inheritdoc}
31 */
32 public function register( Container $container ): void {
33 $container->singleton(
34 PrivacyIntegration::class,
35 function ( Container $c ) {
36 return new PrivacyIntegration(
37 $c->get( LoggerInterface::class ),
38 $c->get( OptInRepositoryInterface::class )
39 );
40 }
41 );
42
43 $container->singleton(
44 SingleConsentExportController::class,
45 function ( Container $c ) {
46 return new SingleConsentExportController(
47 $c->get( LoggerInterface::class ),
48 $c->get( OptInRepositoryInterface::class )
49 );
50 }
51 );
52 }
53
54 /**
55 * {@inheritdoc}
56 */
57 public function boot( Container $container ): void {
58 // Register WordPress Privacy Tools hooks
59 $container->get( PrivacyIntegration::class )->register();
60
61 // Register single-record consent export (fallback if Pro is not active)
62 $container->get( SingleConsentExportController::class )->registerActions();
63 }
64 }
65