Completed
Push — master ( f48699...0b66f1 )
by Michael
29s queued 22s
created

PhpmailerPreload   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 30
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A eventCoreServiceLocateEmail() 0 6 1
A eventCoreServiceLocateUserEmailMessage() 0 6 1
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
use Xoops\Core\PreloadItem;
13
use Xoops\Core\Service\Provider;
14
15
/**
16
 * Gravatars preloads
17
 *
18
 * @category  preloads
19
 * @package   GravatarsPreload
20
 * @author    Richard Griffith <[email protected]>
21
 * @copyright 2014 XOOPS Project (http://xoops.org)
22
 * @license   GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
23
 * @link      http://xoops.org
24
 * @since     2.6.0
25
 */
26
class PhpmailerPreload extends PreloadItem
27
{
28
    /**
29
     * listen for core.service.locate.email event
30
     *
31
     * @param Provider $provider - provider object for requested service
32
     *
33
     * @return void
34
     */
35
    public static function eventCoreServiceLocateEmail(Provider $provider)
36
    {
37
        $path = dirname(__DIR__) . '/class/PhpMailerEmailProvider.php';
38
        require $path;
39
        $object = new PhpMailerEmailProvider();
40
        $provider->register($object);
41
    }
42
43
    /**
44
     * listen for core.service.locate.useremailmessage event
45
     *
46
     * @param Provider $provider - provider object for requested service
47
     *
48
     * @return void
49
     */
50
    public static function eventCoreServiceLocateUserEmailMessage(Provider $provider)
51
    {
52
        $path = dirname(__DIR__) . '/class/PhpMailerMessageProvider.php';
53
        require $path;
54
        $object = new PhpMailerMessageProvider();
55
        $provider->register($object);
56
    }
57
}
58