Passed
Push — master ( ef4669...9202b0 )
by Malte
07:17 queued 02:44
created
examples/custom_message_mask.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      * New custom method which can be called through a mask
17 17
      * @return string
18 18
      */
19
-    public function my_token(){
19
+    public function my_token() {
20 20
         return implode('-', [$this->message_id, $this->uid, $this->message_no]);
21 21
     }
22 22
 
Please login to merge, or discard this patch.
src/IMAP/Query/Query.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,9 @@  discard block
 block discarded – undo
69 69
     public function __construct(Client $client, $charset = 'UTF-8') {
70 70
         $this->setClient($client);
71 71
 
72
-        if(config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
72
+        if(config('imap.options.fetch') === IMAP::FT_PEEK) {
73
+            $this->leaveUnread();
74
+        }
73 75
 
74 76
         $this->date_format = config('imap.date_format', 'd M y');
75 77
 
@@ -107,7 +109,9 @@  discard block
 block discarded – undo
107 109
      * @throws MessageSearchValidationException
108 110
      */
109 111
     protected function parse_date($date) {
110
-        if($date instanceof \Carbon\Carbon) return $date;
112
+        if($date instanceof \Carbon\Carbon) {
113
+            return $date;
114
+        }
111 115
 
112 116
         try {
113 117
             $date = Carbon::parse($date);
@@ -159,7 +163,7 @@  discard block
 block discarded – undo
159 163
         try {
160 164
             if ($this->getCharset() == null) {
161 165
                 $available_messages = \imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID);
162
-            }else{
166
+            } else{
163 167
                 $available_messages = \imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID, $this->getCharset());
164 168
             }
165 169
         } catch (\Exception $e) {
@@ -300,7 +304,7 @@  discard block
 block discarded – undo
300 304
             } else {
301 305
                 if($statement[1] === null){
302 306
                     $query .= $statement[0];
303
-                }else{
307
+                } else{
304 308
                     $query .= $statement[0].' "'.$statement[1].'"';
305 309
                 }
306 310
             }
@@ -330,7 +334,9 @@  discard block
 block discarded – undo
330 334
      * @return $this
331 335
      */
332 336
     public function limit($limit, $page = 1) {
333
-        if($page >= 1) $this->page = $page;
337
+        if($page >= 1) {
338
+            $this->page = $page;
339
+        }
334 340
         $this->limit = $limit;
335 341
 
336 342
         return $this;
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function __construct(Client $client, $charset = 'UTF-8') {
70 70
         $this->setClient($client);
71 71
 
72
-        if(config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
72
+        if (config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
73 73
 
74 74
         $this->date_format = config('imap.date_format', 'd M y');
75 75
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     /**
82 82
      * Instance boot method for additional functionality
83 83
      */
84
-    protected function boot(){}
84
+    protected function boot() {}
85 85
 
86 86
     /**
87 87
      * Parse a given value
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
      *
90 90
      * @return string
91 91
      */
92
-    protected function parse_value($value){
93
-        switch(true){
92
+    protected function parse_value($value) {
93
+        switch (true) {
94 94
             case $value instanceof \Carbon\Carbon:
95 95
                 $value = $value->format($this->date_format);
96 96
                 break;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      * @throws MessageSearchValidationException
108 108
      */
109 109
     protected function parse_date($date) {
110
-        if($date instanceof \Carbon\Carbon) return $date;
110
+        if ($date instanceof \Carbon\Carbon) return $date;
111 111
 
112 112
         try {
113 113
             $date = Carbon::parse($date);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      * @return \Illuminate\Support\Collection
147 147
      * @throws \Webklex\IMAP\Exceptions\ConnectionFailedException
148 148
      */
149
-    protected function search(){
149
+    protected function search() {
150 150
         $this->generate_query();
151 151
         $available_messages = [];
152 152
 
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
         try {
160 160
             if ($this->getCharset() == null) {
161 161
                 $available_messages = \imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID);
162
-            }else{
162
+            } else {
163 163
                 $available_messages = \imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID, $this->getCharset());
164 164
             }
165 165
         } catch (\Exception $e) {
166 166
             if (strpos($e, ' [BADCHARSET (')) {
167 167
                 preg_match('/ \[BADCHARSET \((.*)\)\]/', $e, $matches);
168 168
                 if (isset($matches[1])) {
169
-                    if ($matches[1] !== $this->getCharset()){
169
+                    if ($matches[1] !== $this->getCharset()) {
170 170
                         $this->setCharset($matches[1]);
171 171
                         return $this->search();
172 172
                     }
@@ -210,15 +210,15 @@  discard block
 block discarded – undo
210 210
 
211 211
                 $options = config('imap.options');
212 212
 
213
-                if(strtolower($options['fetch_order']) === 'desc'){
213
+                if (strtolower($options['fetch_order']) === 'desc') {
214 214
                     $available_messages = $available_messages->reverse();
215 215
                 }
216 216
 
217
-                $query =& $this;
217
+                $query = & $this;
218 218
 
219 219
                 $available_messages->forPage($this->page, $this->limit)->each(function($msgno, $msglist) use(&$messages, $options, $query) {
220 220
                     $oMessage = new Message($msgno, $msglist, $query->getClient(), $query->getFetchOptions(), $query->getFetchBody(), $query->getFetchAttachment(), $query->getFetchFlags());
221
-                    switch ($options['message_key']){
221
+                    switch ($options['message_key']) {
222 222
                         case 'number':
223 223
                             $message_key = $oMessage->getMessageNo();
224 224
                             break;
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @return \Illuminate\Pagination\LengthAwarePaginator
250 250
      * @throws GetMessagesFailedException
251 251
      */
252
-    public function paginate($per_page = 5, $page = null, $page_name = 'imap_page'){
252
+    public function paginate($per_page = 5, $page = null, $page_name = 'imap_page') {
253 253
         $this->page = $page > $this->page ? $page : $this->page;
254 254
         $this->limit = $per_page;
255 255
 
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
      * @throws \Webklex\IMAP\Exceptions\ConnectionFailedException
265 265
      * @throws \Webklex\IMAP\Exceptions\InvalidMessageDateException
266 266
      */
267
-    public function idle(callable $callback = null, $timeout = 10){
267
+    public function idle(callable $callback = null, $timeout = 10) {
268 268
         $known_messages = [];
269 269
         $this->getClient()->overview()->each(function($message) use(&$known_messages){
270 270
             /** @var object $message */
271 271
             $known_messages[] = $message->uid;
272 272
         });
273
-        while ($this->getClient()->isConnected()){
273
+        while ($this->getClient()->isConnected()) {
274 274
             $this->getClient()->expunge();
275 275
             $new_messages = [];
276 276
             $this->getClient()->overview()->each(function($message) use(&$new_messages, &$known_messages){
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
                 }
282 282
             });
283 283
 
284
-            foreach($new_messages as $msg) {
284
+            foreach ($new_messages as $msg) {
285 285
                 $message = new Message($msg->uid, $msg->msgno, $this->getClient());
286 286
                 MessageNewEvent::dispatch($message);
287
-                if ($callback){
287
+                if ($callback) {
288 288
                     $callback($message);
289 289
                 }
290 290
             }
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
             if (count($statement) == 1) {
305 305
                 $query .= $statement[0];
306 306
             } else {
307
-                if($statement[1] === null){
307
+                if ($statement[1] === null) {
308 308
                     $query .= $statement[0];
309
-                }else{
309
+                } else {
310 310
                     $query .= $statement[0].' "'.$statement[1].'"';
311 311
                 }
312 312
             }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      * @return $this
337 337
      */
338 338
     public function limit($limit, $page = 1) {
339
-        if($page >= 1) $this->page = $page;
339
+        if ($page >= 1) $this->page = $page;
340 340
         $this->limit = $limit;
341 341
 
342 342
         return $this;
Please login to merge, or discard this patch.
src/IMAP/Message.php 2 patches
Braces   +17 added lines, -9 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                 return $this->attributes[$name];
257 257
             }
258 258
 
259
-        }elseif (strtolower(substr($method, 0, 3)) === 'set') {
259
+        } elseif (strtolower(substr($method, 0, 3)) === 'set') {
260 260
             $name = Str::snake(substr($method, 3));
261 261
 
262 262
             if(in_array($name, array_keys($this->attributes))) {
@@ -386,9 +386,9 @@  discard block
 block discarded – undo
386 386
         if (property_exists($header, 'subject')) {
387 387
             if($this->config['decoder']['message']['subject'] === 'utf-8') {
388 388
                 $this->subject = \imap_utf8($header->subject);
389
-            }elseif($this->config['decoder']['message']['subject'] === 'iconv') {
389
+            } elseif($this->config['decoder']['message']['subject'] === 'iconv') {
390 390
                 $this->subject = iconv_mime_decode($header->subject);
391
-            }else{
391
+            } else{
392 392
                 $this->subject = mb_decode_mimeheader($header->subject);
393 393
             }
394 394
         }
@@ -905,9 +905,9 @@  discard block
 block discarded – undo
905 905
                     return EncodingAliases::get($parameter->value, $this->fallback_encoding);
906 906
                 }
907 907
             }
908
-        }elseif (property_exists($structure, 'charset')) {
908
+        } elseif (property_exists($structure, 'charset')) {
909 909
             return EncodingAliases::get($structure->charset, $this->fallback_encoding);
910
-        }elseif (is_string($structure) === true){
910
+        } elseif (is_string($structure) === true){
911 911
             return mb_detect_encoding($structure);
912 912
         }
913 913
 
@@ -973,7 +973,9 @@  discard block
 block discarded – undo
973 973
      */
974 974
     public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folder = true) {
975 975
 
976
-        if($create_folder) $this->client->createFolder($mailbox, true);
976
+        if($create_folder) {
977
+            $this->client->createFolder($mailbox, true);
978
+        }
977 979
 
978 980
         $target_folder = $this->client->getFolder($mailbox);
979 981
         $target_status = $target_folder->getStatus(IMAP::SA_ALL);
@@ -982,7 +984,9 @@  discard block
 block discarded – undo
982 984
         $status = \imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID);
983 985
 
984 986
         if($status === true){
985
-            if($expunge) $this->client->expunge();
987
+            if($expunge) {
988
+                $this->client->expunge();
989
+            }
986 990
             $this->client->openFolder($target_folder->path);
987 991
 
988 992
             $message = $target_folder->getMessage($target_status->uidnext, null, $this->fetch_options, $this->fetch_body, $this->fetch_attachment, $this->fetch_flags);
@@ -1004,7 +1008,9 @@  discard block
 block discarded – undo
1004 1008
         $this->client->openFolder($this->folder_path);
1005 1009
 
1006 1010
         $status = \imap_delete($this->client->getConnection(), $this->uid, IMAP::FT_UID);
1007
-        if($expunge) $this->client->expunge();
1011
+        if($expunge) {
1012
+            $this->client->expunge();
1013
+        }
1008 1014
         MessageDeletedEvent::dispatch($this);
1009 1015
 
1010 1016
         return $status;
@@ -1021,7 +1027,9 @@  discard block
 block discarded – undo
1021 1027
         $this->client->openFolder($this->folder_path);
1022 1028
 
1023 1029
         $status = \imap_undelete($this->client->getConnection(), $this->uid, IMAP::FT_UID);
1024
-        if($expunge) $this->client->expunge();
1030
+        if($expunge) {
1031
+            $this->client->expunge();
1032
+        }
1025 1033
         MessageRestoredEvent::dispatch($this);
1026 1034
 
1027 1035
         return $status;
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     public function __construct($uid, $msglist, Client $client, $fetch_options = null, $fetch_body = null, $fetch_attachment = null, $fetch_flags = null) {
208 208
 
209 209
         $default_mask = $client->getDefaultMessageMask();
210
-        if($default_mask != null) {
210
+        if ($default_mask != null) {
211 211
             $this->mask = $default_mask;
212 212
         }
213 213
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         $this->msglist = $msglist;
227 227
         $this->client = $client;
228 228
 
229
-        $this->uid =  $uid;
229
+        $this->uid = $uid;
230 230
         $this->msgn = ($this->fetch_options == IMAP::FT_UID) ? \imap_msgno($this->client->getConnection(), $uid) : $uid;
231 231
 
232 232
         $this->parseHeader();
@@ -249,17 +249,17 @@  discard block
 block discarded – undo
249 249
      * @throws MethodNotFoundException
250 250
      */
251 251
     public function __call($method, $arguments) {
252
-        if(strtolower(substr($method, 0, 3)) === 'get') {
252
+        if (strtolower(substr($method, 0, 3)) === 'get') {
253 253
             $name = Str::snake(substr($method, 3));
254 254
 
255
-            if(in_array($name, array_keys($this->attributes))) {
255
+            if (in_array($name, array_keys($this->attributes))) {
256 256
                 return $this->attributes[$name];
257 257
             }
258 258
 
259 259
         }elseif (strtolower(substr($method, 0, 3)) === 'set') {
260 260
             $name = Str::snake(substr($method, 3));
261 261
 
262
-            if(in_array($name, array_keys($this->attributes))) {
262
+            if (in_array($name, array_keys($this->attributes))) {
263 263
                 $this->attributes[$name] = array_pop($arguments);
264 264
 
265 265
                 return $this->attributes[$name];
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
      * @return mixed|null
289 289
      */
290 290
     public function __get($name) {
291
-        if(isset($this->attributes[$name])) {
291
+        if (isset($this->attributes[$name])) {
292 292
             return $this->attributes[$name];
293 293
         }
294 294
 
@@ -384,16 +384,16 @@  discard block
 block discarded – undo
384 384
         }
385 385
 
386 386
         if (property_exists($header, 'subject')) {
387
-            if($this->config['decoder']['message']['subject'] === 'utf-8') {
387
+            if ($this->config['decoder']['message']['subject'] === 'utf-8') {
388 388
                 $this->subject = \imap_utf8($header->subject);
389
-            }elseif($this->config['decoder']['message']['subject'] === 'iconv') {
389
+            }elseif ($this->config['decoder']['message']['subject'] === 'iconv') {
390 390
                 $this->subject = iconv_mime_decode($header->subject);
391
-            }else{
391
+            } else {
392 392
                 $this->subject = mb_decode_mimeheader($header->subject);
393 393
             }
394 394
         }
395 395
 
396
-        foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $part){
396
+        foreach (['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $part) {
397 397
             $this->extractHeaderAddressPart($header, $part);
398 398
         }
399 399
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
      * @return int|null
424 424
      */
425 425
     private function extractPriority($header) {
426
-        if(preg_match('/x\-priority\:.*([0-9]{1,2})/i', $header, $priority)){
426
+        if (preg_match('/x\-priority\:.*([0-9]{1,2})/i', $header, $priority)) {
427 427
             $priority = isset($priority[1]) ? (int) $priority[1] : 0;
428
-            switch($priority){
428
+            switch ($priority) {
429 429
                 case IMAP::MESSAGE_PRIORITY_HIGHEST;
430 430
                     $priority = IMAP::MESSAGE_PRIORITY_HIGHEST;
431 431
                     break;
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
         if (property_exists($header, 'date')) {
477 477
             $date = $header->date;
478 478
 
479
-            if(preg_match('/\+0580/', $date)) {
479
+            if (preg_match('/\+0580/', $date)) {
480 480
                 $date = str_replace('+0580', '+0530', $date);
481 481
             }
482 482
 
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
                         $date = trim(array_pop($array));
500 500
                         break;
501 501
                 }
502
-                try{
502
+                try {
503 503
                     $parsed_date = Carbon::parse($date);
504 504
                 } catch (\Exception $_e) {
505 505
                     throw new InvalidMessageDateException("Invalid message date. ID:".$this->getMessageId(), 1100, $e);
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
         $this->client->openFolder($this->folder_path);
523 523
         $flags = \imap_fetch_overview($this->client->getConnection(), $this->uid, IMAP::FT_UID);
524 524
         if (is_array($flags) && isset($flags[0])) {
525
-            foreach($this->available_flags as $flag) {
525
+            foreach ($this->available_flags as $flag) {
526 526
                 $this->parseFlag($flags, $flag);
527 527
             }
528 528
         }
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
             } else {
595 595
                 $personalParts = \imap_mime_header_decode($address->personal);
596 596
 
597
-                if(is_array($personalParts)) {
597
+                if (is_array($personalParts)) {
598 598
                     $address->personal = '';
599 599
                     foreach ($personalParts as $p) {
600 600
                         $address->personal .= $this->convertEncoding($p->text, $this->getEncoding($p));
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
      * @return object
673 673
      * @throws Exceptions\ConnectionFailedException
674 674
      */
675
-    private function createBody($type, $structure, $partNumber){
675
+    private function createBody($type, $structure, $partNumber) {
676 676
         return (object) [
677 677
             "type" => $type,
678 678
             "content" => $this->fetchPart($structure, $partNumber),
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
      * @return mixed|string
688 688
      * @throws Exceptions\ConnectionFailedException
689 689
      */
690
-    private function fetchPart($structure, $partNumber){
690
+    private function fetchPart($structure, $partNumber) {
691 691
         $encoding = $this->getEncoding($structure);
692 692
 
693 693
         if (!$partNumber) {
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
             }
893 893
         }elseif (property_exists($structure, 'charset')) {
894 894
             return EncodingAliases::get($structure->charset, $this->fallback_encoding);
895
-        }elseif (is_string($structure) === true){
895
+        }elseif (is_string($structure) === true) {
896 896
             return mb_detect_encoding($structure);
897 897
         }
898 898
 
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
         return null;
943 943
     }
944 944
 
945
-    public function getFolder(){
945
+    public function getFolder() {
946 946
         return $this->client->getFolder($this->folder_path);
947 947
     }
948 948
 
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
      */
959 959
     public function moveToFolder($mailbox = 'INBOX', $expunge = false, $create_folder = true) {
960 960
 
961
-        if($create_folder) $this->client->createFolder($mailbox, true);
961
+        if ($create_folder) $this->client->createFolder($mailbox, true);
962 962
 
963 963
         $target_folder = $this->client->getFolder($mailbox);
964 964
         $target_status = $target_folder->getStatus(IMAP::SA_ALL);
@@ -966,8 +966,8 @@  discard block
 block discarded – undo
966 966
         $this->client->openFolder($this->folder_path);
967 967
         $status = \imap_mail_move($this->client->getConnection(), $this->uid, $mailbox, IMAP::CP_UID);
968 968
 
969
-        if($status === true){
970
-            if($expunge) $this->client->expunge();
969
+        if ($status === true) {
970
+            if ($expunge) $this->client->expunge();
971 971
             $this->client->openFolder($target_folder->path);
972 972
 
973 973
             $message = $target_folder->getMessage($target_status->uidnext, null, $this->fetch_options, $this->fetch_body, $this->fetch_attachment, $this->fetch_flags);
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
         $this->client->openFolder($this->folder_path);
990 990
 
991 991
         $status = \imap_delete($this->client->getConnection(), $this->uid, IMAP::FT_UID);
992
-        if($expunge) $this->client->expunge();
992
+        if ($expunge) $this->client->expunge();
993 993
         MessageDeletedEvent::dispatch($this);
994 994
 
995 995
         return $status;
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
         $this->client->openFolder($this->folder_path);
1007 1007
 
1008 1008
         $status = \imap_undelete($this->client->getConnection(), $this->uid, IMAP::FT_UID);
1009
-        if($expunge) $this->client->expunge();
1009
+        if ($expunge) $this->client->expunge();
1010 1010
         MessageRestoredEvent::dispatch($this);
1011 1011
 
1012 1012
         return $status;
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
      * @return string
1084 1084
      * @throws Exceptions\ConnectionFailedException
1085 1085
      */
1086
-    public function getToken(){
1086
+    public function getToken() {
1087 1087
         return base64_encode(implode('-', [$this->message_id, $this->subject, strlen($this->getRawBody())]));
1088 1088
     }
1089 1089
 
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
     /**
1147 1147
      * @return object|null
1148 1148
      */
1149
-    public function getStructure(){
1149
+    public function getStructure() {
1150 1150
         return $this->structure;
1151 1151
     }
1152 1152
 
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
     /**
1171 1171
      * @return array
1172 1172
      */
1173
-    public function getAttributes(){
1173
+    public function getAttributes() {
1174 1174
         return $this->attributes;
1175 1175
     }
1176 1176
 
@@ -1178,8 +1178,8 @@  discard block
 block discarded – undo
1178 1178
      * @param $mask
1179 1179
      * @return $this
1180 1180
      */
1181
-    public function setMask($mask){
1182
-        if(class_exists($mask)){
1181
+    public function setMask($mask) {
1182
+        if (class_exists($mask)) {
1183 1183
             $this->mask = $mask;
1184 1184
         }
1185 1185
 
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
     /**
1190 1190
      * @return string
1191 1191
      */
1192
-    public function getMask(){
1192
+    public function getMask() {
1193 1193
         return $this->mask;
1194 1194
     }
1195 1195
 
@@ -1200,9 +1200,9 @@  discard block
 block discarded – undo
1200 1200
      * @return mixed
1201 1201
      * @throws MaskNotFoundException
1202 1202
      */
1203
-    public function mask($mask = null){
1203
+    public function mask($mask = null) {
1204 1204
         $mask = $mask !== null ? $mask : $this->mask;
1205
-        if(class_exists($mask)){
1205
+        if (class_exists($mask)) {
1206 1206
             return new $mask($this);
1207 1207
         }
1208 1208
 
Please login to merge, or discard this patch.