Mailer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
ccs 5
cts 5
cp 1
c 0
b 0
f 0
rs 10
wmc 1

1 Method

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

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
53
    {
54 1
        $instance = new Instance();
55 1
        $instance->setOptions(Config::get('mailer'));
56 1
        $instance->init();
57 1
        return $instance;
58
    }
59
}
60