Completed
Push — master ( 4ecd26...84af35 )
by Anton
12s
created

Mailer::initInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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