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 / CoreServiceProvider.php

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

64 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Core Service Provider
4 *
5 * @package Forge12\DoubleOptIn\Providers
6 * @since 4.0.0
7 */
8
9 namespace Forge12\DoubleOptIn\Providers;
10
11 use Forge12\DoubleOptIn\Container\Container;
12 use Forge12\DoubleOptIn\Container\BootableProviderInterface;
13 use Forge12\Shared\LoggerInterface;
14 use Forge12\Shared\Logger;
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit;
18 }
19
20 /**
21 * Class CoreServiceProvider
22 *
23 * Registers core services like Logger, TemplateHandler, Messages.
24 */
25 class CoreServiceProvider implements BootableProviderInterface {
26
27 /**
28 * {@inheritdoc}
29 */
30 public function register( Container $container ): void {
31 // Logger
32 $container->singleton(
33 LoggerInterface::class,
34 function () {
35 return Logger::getInstance();
36 }
37 );
38
39 // TemplateHandler
40 $container->singleton(
41 \forge12\contactform7\CF7DoubleOptIn\TemplateHandler::class,
42 function () {
43 return \forge12\contactform7\CF7DoubleOptIn\TemplateHandler::getInstance();
44 }
45 );
46
47 // Messages
48 $container->singleton(
49 \forge12\contactform7\CF7DoubleOptIn\Messages::class,
50 function () {
51 return \forge12\contactform7\CF7DoubleOptIn\Messages::getInstance();
52 }
53 );
54 }
55
56 /**
57 * {@inheritdoc}
58 */
59 public function boot( Container $container ): void {
60 // Initialize logger in container for debugging
61 $container->setLogger( $container->get( LoggerInterface::class ) );
62 }
63 }
64