@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function __construct($parent) { |
39 | 39 | $this->parent = $parent; |
40 | 40 | |
41 | - if(method_exists($this->parent, 'getAttributes')){ |
|
41 | + if (method_exists($this->parent, 'getAttributes')) { |
|
42 | 42 | $this->attributes = array_merge($this->attributes, $this->parent->getAttributes()); |
43 | 43 | } |
44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Boot method made to be used by any custom mask |
50 | 50 | */ |
51 | - protected function boot(){} |
|
51 | + protected function boot() {} |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Call dynamic attribute setter and getter methods and inherit the parent calls |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | * @throws MethodNotFoundException |
60 | 60 | */ |
61 | 61 | public function __call($method, $arguments) { |
62 | - if(strtolower(substr($method, 0, 3)) === 'get') { |
|
62 | + if (strtolower(substr($method, 0, 3)) === 'get') { |
|
63 | 63 | $name = snake_case(substr($method, 3)); |
64 | 64 | |
65 | - if(isset($this->attributes[$name])) { |
|
65 | + if (isset($this->attributes[$name])) { |
|
66 | 66 | return $this->attributes[$name]; |
67 | 67 | } |
68 | 68 | |
69 | 69 | }elseif (strtolower(substr($method, 0, 3)) === 'set') { |
70 | 70 | $name = snake_case(substr($method, 3)); |
71 | 71 | |
72 | - if(isset($this->attributes[$name])) { |
|
72 | + if (isset($this->attributes[$name])) { |
|
73 | 73 | $this->attributes[$name] = array_pop($arguments); |
74 | 74 | |
75 | 75 | return $this->attributes[$name]; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | } |
79 | 79 | |
80 | - if(method_exists($this->parent, $method) === true){ |
|
80 | + if (method_exists($this->parent, $method) === true) { |
|
81 | 81 | return call_user_func_array([$this->parent, $method], $arguments); |
82 | 82 | } |
83 | 83 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return mixed|null |
103 | 103 | */ |
104 | 104 | public function __get($name) { |
105 | - if(isset($this->attributes[$name])) { |
|
105 | + if (isset($this->attributes[$name])) { |
|
106 | 106 | return $this->attributes[$name]; |
107 | 107 | } |
108 | 108 | |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * @return mixed |
114 | 114 | */ |
115 | - public function getParent(){ |
|
115 | + public function getParent() { |
|
116 | 116 | return $this->parent; |
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
120 | 120 | * @return array |
121 | 121 | */ |
122 | - public function getAttributes(){ |
|
122 | + public function getAttributes() { |
|
123 | 123 | return $this->attributes; |
124 | 124 | } |
125 | 125 |
@@ -172,45 +172,45 @@ discard block |
||
172 | 172 | * @throws MaskNotFoundException |
173 | 173 | */ |
174 | 174 | protected function setMaskFromConfig($config) { |
175 | - $default_config = config("imap.masks"); |
|
175 | + $default_config = config("imap.masks"); |
|
176 | 176 | |
177 | - if(isset($config['masks'])){ |
|
178 | - if(isset($config['masks']['message'])) { |
|
179 | - if(class_exists($config['masks']['message'])) { |
|
177 | + if (isset($config['masks'])) { |
|
178 | + if (isset($config['masks']['message'])) { |
|
179 | + if (class_exists($config['masks']['message'])) { |
|
180 | 180 | $this->default_message_mask = $config['masks']['message']; |
181 | - }else{ |
|
181 | + } else { |
|
182 | 182 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['message']); |
183 | 183 | } |
184 | - }else{ |
|
185 | - if(class_exists($default_config['message'])) { |
|
184 | + } else { |
|
185 | + if (class_exists($default_config['message'])) { |
|
186 | 186 | $this->default_message_mask = $default_config['message']; |
187 | - }else{ |
|
187 | + } else { |
|
188 | 188 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']); |
189 | 189 | } |
190 | 190 | } |
191 | - if(isset($config['masks']['attachment'])) { |
|
192 | - if(class_exists($config['masks']['attachment'])) { |
|
191 | + if (isset($config['masks']['attachment'])) { |
|
192 | + if (class_exists($config['masks']['attachment'])) { |
|
193 | 193 | $this->default_message_mask = $config['masks']['attachment']; |
194 | - }else{ |
|
194 | + } else { |
|
195 | 195 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']); |
196 | 196 | } |
197 | - }else{ |
|
198 | - if(class_exists($default_config['attachment'])) { |
|
197 | + } else { |
|
198 | + if (class_exists($default_config['attachment'])) { |
|
199 | 199 | $this->default_message_mask = $default_config['attachment']; |
200 | - }else{ |
|
200 | + } else { |
|
201 | 201 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']); |
202 | 202 | } |
203 | 203 | } |
204 | - }else{ |
|
205 | - if(class_exists($default_config['message'])) { |
|
204 | + } else { |
|
205 | + if (class_exists($default_config['message'])) { |
|
206 | 206 | $this->default_message_mask = $default_config['message']; |
207 | - }else{ |
|
207 | + } else { |
|
208 | 208 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']); |
209 | 209 | } |
210 | 210 | |
211 | - if(class_exists($default_config['attachment'])) { |
|
211 | + if (class_exists($default_config['attachment'])) { |
|
212 | 212 | $this->default_message_mask = $default_config['attachment']; |
213 | - }else{ |
|
213 | + } else { |
|
214 | 214 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']); |
215 | 215 | } |
216 | 216 | } |
@@ -400,8 +400,8 @@ discard block |
||
400 | 400 | */ |
401 | 401 | public function createFolder($name, $expunge = true) { |
402 | 402 | $this->checkConnection(); |
403 | - $status = imap_createmailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($name)); |
|
404 | - if($expunge) $this->expunge(); |
|
403 | + $status = imap_createmailbox($this->getConnection(), $this->getAddress().imap_utf7_encode($name)); |
|
404 | + if ($expunge) $this->expunge(); |
|
405 | 405 | |
406 | 406 | return $status; |
407 | 407 | } |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | */ |
418 | 418 | public function renameFolder($old_name, $new_name, $expunge = true) { |
419 | 419 | $this->checkConnection(); |
420 | - $status = imap_renamemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($old_name), $this->getAddress() . imap_utf7_encode($new_name)); |
|
421 | - if($expunge) $this->expunge(); |
|
420 | + $status = imap_renamemailbox($this->getConnection(), $this->getAddress().imap_utf7_encode($old_name), $this->getAddress().imap_utf7_encode($new_name)); |
|
421 | + if ($expunge) $this->expunge(); |
|
422 | 422 | |
423 | 423 | return $status; |
424 | 424 | } |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | */ |
434 | 434 | public function deleteFolder($name, $expunge = true) { |
435 | 435 | $this->checkConnection(); |
436 | - $status = imap_deletemailbox($this->getConnection(), $this->getAddress() . imap_utf7_encode($name)); |
|
437 | - if($expunge) $this->expunge(); |
|
436 | + $status = imap_deletemailbox($this->getConnection(), $this->getAddress().imap_utf7_encode($name)); |
|
437 | + if ($expunge) $this->expunge(); |
|
438 | 438 | |
439 | 439 | return $status; |
440 | 440 | } |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | if (!$this->validate_cert) { |
529 | 529 | $address .= '/novalidate-cert'; |
530 | 530 | } |
531 | - if (in_array($this->encryption,['tls','ssl'])) { |
|
531 | + if (in_array($this->encryption, ['tls', 'ssl'])) { |
|
532 | 532 | $address .= '/'.$this->encryption; |
533 | 533 | } |
534 | 534 | |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | * @throws InvalidImapTimeoutTypeException |
650 | 650 | */ |
651 | 651 | public function setTimeout($type, $timeout) { |
652 | - if(0 <= $type && $type <= 4) { |
|
652 | + if (0 <= $type && $type <= 4) { |
|
653 | 653 | return imap_timeout($type, $timeout); |
654 | 654 | } |
655 | 655 | |
@@ -663,8 +663,8 @@ discard block |
||
663 | 663 | * @return mixed |
664 | 664 | * @throws InvalidImapTimeoutTypeException |
665 | 665 | */ |
666 | - public function getTimeout($type){ |
|
667 | - if(0 <= $type && $type <= 4) { |
|
666 | + public function getTimeout($type) { |
|
667 | + if (0 <= $type && $type <= 4) { |
|
668 | 668 | return imap_timeout($type); |
669 | 669 | } |
670 | 670 | |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | /** |
675 | 675 | * @return string |
676 | 676 | */ |
677 | - public function getDefaultMessageMask(){ |
|
677 | + public function getDefaultMessageMask() { |
|
678 | 678 | return $this->default_message_mask; |
679 | 679 | } |
680 | 680 | |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | * @throws MaskNotFoundException |
686 | 686 | */ |
687 | 687 | public function setDefaultMessageMask($mask) { |
688 | - if(class_exists($mask)) { |
|
688 | + if (class_exists($mask)) { |
|
689 | 689 | $this->default_message_mask = $mask; |
690 | 690 | |
691 | 691 | return $this; |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | /** |
698 | 698 | * @return string |
699 | 699 | */ |
700 | - public function getDefaultAttachmentMask(){ |
|
700 | + public function getDefaultAttachmentMask() { |
|
701 | 701 | return $this->default_attachment_mask; |
702 | 702 | } |
703 | 703 | |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | * @throws MaskNotFoundException |
709 | 709 | */ |
710 | 710 | public function setDefaultAttachmentMask($mask) { |
711 | - if(class_exists($mask)) { |
|
711 | + if (class_exists($mask)) { |
|
712 | 712 | $this->default_attachment_mask = $mask; |
713 | 713 | |
714 | 714 | return $this; |