ImportedMessage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSwiftMessage() 0 3 1
A __construct() 0 4 1
A addSignature() 0 3 1
A setSignature() 0 3 1
1
<?php
2
/**
3
 * @link https://github.com/Izumi-kun/yii2-spoolmailer
4
 * @copyright Copyright (c) 2017 Viktor Khokhryakov
5
 * @license http://opensource.org/licenses/BSD-3-Clause
6
 */
7
8
namespace izumi\spoolmailer;
9
10
use Swift_Message;
11
use yii\base\NotSupportedException;
12
13
/**
14
 * Class allows creating `Message` from `Swift_Message` instance.
15
 *
16
 * @author Viktor Khokhryakov <[email protected]>
17
 */
18
class ImportedMessage extends \yii\swiftmailer\Message
19
{
20
    /**
21
     * @var Swift_Message Swift message instance.
22
     */
23
    private $_swiftMessage;
24
25
    /**
26
     * @inheritdoc
27
     * @param Swift_Message $message
28
     */
29 10
    public function __construct(Swift_Message $message, array $config = [])
30
    {
31 10
        $this->_swiftMessage = $message;
32 10
        parent::__construct($config);
33 10
    }
34
35
    /**
36
     * @inheritdoc
37
     */
38 8
    public function getSwiftMessage()
39
    {
40 8
        return $this->_swiftMessage;
41
    }
42
43
    /**
44
     * @inheritdoc
45
     */
46 1
    public function setSignature($signature)
47
    {
48 1
        throw new NotSupportedException();
49
    }
50
51
    /**
52
     * @inheritdoc
53
     */
54 1
    public function addSignature($signature)
55
    {
56 1
        throw new NotSupportedException();
57
    }
58
}
59