ImportedMessage::setSignature()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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