GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ParsedMessage::getFrom()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Hautzi\SystemMailBundle\SystemMailer;
4
5
class ParsedMessage
6
{
7
    private $from = [];
8
    private $replyTo;
9
10
    private $to  = [];
11
    private $cc  = [];
12
    private $bcc = [];
13
14
    private $subject;
15
16
    private $messageHtml;
17
18
    private $messageText;
19
20
    /**
21
     * @param string $email
22
     * @param string $name
23
     *
24
     * @return array
25
     */
26
    protected function transformEmailName($email, $name = '')
27
    {
28
        if (!$name) {
29
            return [$email];
30
        }
31
32
        return [$email => $name];
33
    }
34
35
    /**
36
     * Gets from
37
     *
38
     * @return array
39
     */
40
    public function getFrom()
41
    {
42
        return $this->from;
43
    }
44
45
    /**
46
     * Sets from
47
     *
48
     * @param string $email
49
     * @param string $name
50
     *
51
     * @return static
52
     */
53
    public function setFrom($email, $name = null)
54
    {
55
        $this->from = $this->transformEmailName($email, $name);
56
57
        return $this;
58
    }
59
60
    /**
61
     * Gets replyTo
62
     *
63
     * @return string
64
     */
65
    public function getReplyTo()
66
    {
67
        return $this->replyTo;
68
    }
69
70
    /**
71
     * Sets replyTo
72
     *
73
     * @param mixed $replyTo
74
     *
75
     * @return static
76
     */
77
    public function setReplyTo($replyTo)
78
    {
79
        $this->replyTo = $replyTo;
80
81
        return $this;
82
    }
83
84
    /**
85
     * Gets to
86
     *
87
     * @return array
88
     */
89
    public function getTo()
90
    {
91
        return $this->to;
92
    }
93
94
    /**
95
     * Sets to
96
     *
97
     * @param string $email
98
     * @param string $name
99
     *
100
     * @return static
101
     */
102
    public function addTo($email, $name = null)
103
    {
104
        $this->to = array_merge($this->to, $this->transformEmailName($email, $name));
105
106
        return $this;
107
    }
108
109
    /**
110
     * Gets cc
111
     *
112
     * @return array
113
     */
114
    public function getCc()
115
    {
116
        return $this->cc;
117
    }
118
119
    /**
120
     * Sets cc
121
     *
122
     * @param string $email
123
     * @param string $name
124
     *
125
     * @return static
126
     */
127
    public function addCc($email, $name = null)
128
    {
129
        $this->cc = array_merge($this->cc, $this->transformEmailName($email, $name));
130
131
        return $this;
132
    }
133
134
135
    /**
136
     * Gets bcc
137
     *
138
     * @return array
139
     */
140
    public function getBcc()
141
    {
142
        return $this->bcc;
143
    }
144
145
    /**
146
     * Sets bcc
147
     *
148
     * @param string $email
149
     * @param string $name
150
     *
151
     * @return static
152
     */
153
    public function addBcc($email, $name = null)
154
    {
155
        $this->bcc = array_merge($this->bcc, $this->transformEmailName($email, $name));
156
157
        return $this;
158
    }
159
160
    /**
161
     * Gets subject
162
     *
163
     * @return string
164
     */
165
    public function getSubject()
166
    {
167
        return $this->subject;
168
    }
169
170
    /**
171
     * Sets subject
172
     *
173
     * @param string $subject
174
     *
175
     * @return static
176
     */
177
    public function setSubject($subject)
178
    {
179
        $this->subject = $subject;
180
181
        return $this;
182
    }
183
184
    /**
185
     * Gets messageHtml
186
     *
187
     * @return string
188
     */
189
    public function getMessageHtml()
190
    {
191
        return $this->messageHtml;
192
    }
193
194
    /**
195
     * Sets messageHtml
196
     *
197
     * @param string $messageHtml
198
     *
199
     * @return static
200
     */
201
    public function setMessageHtml($messageHtml)
202
    {
203
        $this->messageHtml = $messageHtml;
204
205
        return $this;
206
    }
207
208
    /**
209
     * Gets messageText
210
     *
211
     * @return string
212
     */
213
    public function getMessageText()
214
    {
215
        return $this->messageText;
216
    }
217
218
    /**
219
     * Sets messageText
220
     *
221
     * @param string $messageText
222
     *
223
     * @return static
224
     */
225
    public function setMessageText($messageText)
226
    {
227
        $this->messageText = $messageText;
228
229
        return $this;
230
    }
231
}
232