Completed
Push — master ( f7bed6...7b8b9a )
by Gabriel
05:48 queued 11s
created

Message::addMergeTag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 1
1
<?php
2
3
namespace Nip\Mail;
4
5
use Swift_Message;
6
use Swift_Mime_Message;
7
8
/**
9
 * Class Message
10
 * @package Nip\Mail
11
 */
12
class Message extends Swift_Message implements Swift_Mime_Message
13
{
14
    protected $mergeTags = [];
15
    protected $custom_args = [];
16
17
    /**
18
     * @return array
19
     */
20 1
    public function getMergeTags()
21
    {
22 1
        return $this->mergeTags;
23
    }
24
25
    /**
26
     * @param array $mergeTags
27
     */
28
    public function setMergeTags($mergeTags)
29
    {
30
        $this->mergeTags = $mergeTags;
31
    }
32
33
    /**
34
     * @param $name
35
     * @param $value
36
     */
37 1
    public function addMergeTag($name, $value)
38
    {
39 1
        $this->mergeTags[$name] = $value;
40 1
    }
41
42
    /**
43
     * @return array
44
     */
45
    public function getCustomArgs()
46
    {
47
        return $this->custom_args;
48
    }
49
50
    /**
51
     * @param array $custom_args
52
     */
53
    public function setCustomArgs($custom_args)
54
    {
55
        $this->custom_args = $custom_args;
56
    }
57
58
    /**
59
     * @param $key
60
     * @param $value
61
     */
62
    public function addCustomArg($key, $value)
63
    {
64
        $this->custom_args[$key] = $value;
65
    }
66
}
67