Completed
Pull Request — master (#410)
by Anton
06:09
created

Mailer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A initInstance() 0 6 1
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Proxy;
12
13
use Bluz\Mailer\Mailer as Instance;
14
15
/**
16
 * Proxy to Mailer
17
 *
18
 * Example of usage
19
 * <code>
20
 *     use Bluz\Proxy\Mailer;
21
 *
22
 *     $mail = Mailer::create();
23
 *     $mail->From = '[email protected]';
24
 *     $mail->Subject = 'Here is the subject';
25
 *     // ...
26
 *     Mailer::send($mail);
27
 * </code>
28
 *
29
 * @package  Bluz\Proxy
30
 * @author   Anton Shevchuk
31
 *
32
 * @method   static Instance getInstance()
33
 *
34
 * @method   static \PHPMailer create()
35
 * @see      Instance::create()
36
 *
37
 * @method   static bool send(\PHPMailer $mail)
38
 * @see      Instance::send()
39
 */
40
class Mailer
41
{
42
    use ProxyTrait;
43
44
    /**
45
     * Init instance
46
     *
47
     * @return Instance
48
     */
49 1
    protected static function initInstance()
50
    {
51 1
        $instance = new Instance();
52 1
        $instance->setOptions(Config::getData('mailer'));
53 1
        return $instance;
54
    }
55
}
56