@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function add($value, $strict = false) { |
75 | 75 | if (is_array($value)) { |
76 | 76 | return $this->merge($value, $strict); |
77 | - }elseif ($value !== null) { |
|
77 | + } elseif ($value !== null) { |
|
78 | 78 | $this->attach($value, $strict); |
79 | 79 | } |
80 | 80 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | if ($this->contains($value) === false) { |
124 | 124 | $this->values[] = $value; |
125 | 125 | } |
126 | - }else{ |
|
126 | + } else{ |
|
127 | 127 | $this->values[] = $value; |
128 | 128 | } |
129 | 129 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | public function set($name, $value, $strict = false) { |
121 | 121 | if(isset($this->attributes[$name]) && $strict === false) { |
122 | 122 | $this->attributes[$name]->add($value, true); |
123 | - }else{ |
|
123 | + } else{ |
|
124 | 124 | $this->attributes[$name] = new Attribute($name, $value); |
125 | 125 | } |
126 | 126 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if ($prev_header !== null) { |
208 | 208 | $headers[$prev_header][] = $line; |
209 | 209 | } |
210 | - }elseif (substr($line, 0, 1) === " ") { |
|
210 | + } elseif (substr($line, 0, 1) === " ") { |
|
211 | 211 | $line = substr($line, 1); |
212 | 212 | $line = trim(rtrim($line)); |
213 | 213 | if ($prev_header !== null) { |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | } |
217 | 217 | if (is_array($headers[$prev_header])) { |
218 | 218 | $headers[$prev_header][] = $line; |
219 | - }else{ |
|
219 | + } else{ |
|
220 | 220 | $headers[$prev_header] .= $line; |
221 | 221 | } |
222 | 222 | } |
223 | - }else{ |
|
223 | + } else{ |
|
224 | 224 | if (($pos = strpos($line, ":")) > 0) { |
225 | 225 | $key = trim(rtrim(strtolower(substr($line, 0, $pos)))); |
226 | 226 | $key = str_replace("-", "_", $key); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $value = trim(rtrim(substr($line, $pos + 1))); |
229 | 229 | if (isset($headers[$key])) { |
230 | 230 | $headers[$key][] = $value; |
231 | - }else{ |
|
231 | + } else{ |
|
232 | 232 | $headers[$key] = [$value]; |
233 | 233 | } |
234 | 234 | $prev_header = $key; |
@@ -237,7 +237,9 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | foreach($headers as $key => $values) { |
240 | - if (isset($imap_headers[$key])) continue; |
|
240 | + if (isset($imap_headers[$key])) { |
|
241 | + continue; |
|
242 | + } |
|
241 | 243 | $value = null; |
242 | 244 | switch($key){ |
243 | 245 | case 'from': |
@@ -374,9 +376,9 @@ discard block |
||
374 | 376 | return EncodingAliases::get($parameter->value, $this->fallback_encoding); |
375 | 377 | } |
376 | 378 | } |
377 | - }elseif (property_exists($structure, 'charset')) { |
|
379 | + } elseif (property_exists($structure, 'charset')) { |
|
378 | 380 | return EncodingAliases::get($structure->charset, $this->fallback_encoding); |
379 | - }elseif (is_string($structure) === true){ |
|
381 | + } elseif (is_string($structure) === true){ |
|
380 | 382 | return mb_detect_encoding($structure); |
381 | 383 | } |
382 | 384 | |
@@ -410,9 +412,9 @@ discard block |
||
410 | 412 | } |
411 | 413 | } |
412 | 414 | } |
413 | - }elseif($decoder === 'iconv') { |
|
415 | + } elseif($decoder === 'iconv') { |
|
414 | 416 | $value = iconv_mime_decode($value); |
415 | - }else{ |
|
417 | + } else{ |
|
416 | 418 | $value = mb_decode_mimeheader($value); |
417 | 419 | } |
418 | 420 | |
@@ -445,7 +447,9 @@ discard block |
||
445 | 447 | * Try to extract the priority from a given raw header string |
446 | 448 | */ |
447 | 449 | private function findPriority() { |
448 | - if(($priority = $this->get("x_priority")) === null) return; |
|
450 | + if(($priority = $this->get("x_priority")) === null) { |
|
451 | + return; |
|
452 | + } |
|
449 | 453 | switch((int)"$priority"){ |
450 | 454 | case IMAP::MESSAGE_PRIORITY_HIGHEST; |
451 | 455 | $priority = IMAP::MESSAGE_PRIORITY_HIGHEST; |