@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public static function has($key) |
21 | 21 | { |
22 | - return ! is_null(static::$app['request']->cookie($key, null)); |
|
22 | + return !is_null(static::$app['request']->cookie($key, null)); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public static function routes(array $options = []) |
58 | 58 | { |
59 | - if (! static::$app->providerIsLoaded(UiServiceProvider::class)) { |
|
59 | + if (!static::$app->providerIsLoaded(UiServiceProvider::class)) { |
|
60 | 60 | throw new RuntimeException('In order to use the Auth::routes() method, please install the laravel/ui package.'); |
61 | 61 | } |
62 | 62 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $callback(static::getFacadeRoot()); |
38 | 38 | } |
39 | 39 | |
40 | - static::$app->afterResolving($accessor, function ($service) use ($callback) { |
|
40 | + static::$app->afterResolving($accessor, function($service) use ($callback) { |
|
41 | 41 | $callback($service); |
42 | 42 | }); |
43 | 43 | } |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public static function spy() |
51 | 51 | { |
52 | - if (! static::isMock()) { |
|
52 | + if (!static::isMock()) { |
|
53 | 53 | $class = static::getMockableClass(); |
54 | 54 | |
55 | - return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) { |
|
55 | + return tap($class ? Mockery::spy($class) : Mockery::spy(), function($spy) { |
|
56 | 56 | static::swap($spy); |
57 | 57 | }); |
58 | 58 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected static function createFreshMockInstance() |
99 | 99 | { |
100 | - return tap(static::createMock(), function ($mock) { |
|
100 | + return tap(static::createMock(), function($mock) { |
|
101 | 101 | static::swap($mock); |
102 | 102 | |
103 | 103 | $mock->shouldAllowMockingProtectedMethods(); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | { |
255 | 255 | $instance = static::getFacadeRoot(); |
256 | 256 | |
257 | - if (! $instance) { |
|
257 | + if (!$instance) { |
|
258 | 258 | throw new RuntimeException('A facade root has not been set.'); |
259 | 259 | } |
260 | 260 |
@@ -109,7 +109,7 @@ |
||
109 | 109 | */ |
110 | 110 | protected static function resolveFacadeInstance($name) |
111 | 111 | { |
112 | - if (! isset(static::$resolvedInstance[$name]) && ! isset(static::$app, static::$app[$name])) { |
|
112 | + if (!isset(static::$resolvedInstance[$name]) && !isset(static::$app, static::$app[$name])) { |
|
113 | 113 | $class = static::DEFAULT_FACADE; |
114 | 114 | |
115 | 115 | static::swap(new $class); |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | public static function fakeExcept($eventsToAllow) |
55 | 55 | { |
56 | 56 | return static::fake([ |
57 | - function ($eventName) use ($eventsToAllow) { |
|
58 | - return ! in_array($eventName, (array) $eventsToAllow); |
|
57 | + function($eventName) use ($eventsToAllow) { |
|
58 | + return !in_array($eventName, (array) $eventsToAllow); |
|
59 | 59 | }, |
60 | 60 | ]); |
61 | 61 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | static::fake($eventsToFake); |
75 | 75 | |
76 | - return tap($callable(), function () use ($originalDispatcher) { |
|
76 | + return tap($callable(), function() use ($originalDispatcher) { |
|
77 | 77 | static::swap($originalDispatcher); |
78 | 78 | |
79 | 79 | Model::setEventDispatcher($originalDispatcher); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | static::fakeExcept($eventsToAllow); |
96 | 96 | |
97 | - return tap($callable(), function () use ($originalDispatcher) { |
|
97 | + return tap($callable(), function() use ($originalDispatcher) { |
|
98 | 98 | static::swap($originalDispatcher); |
99 | 99 | |
100 | 100 | Model::setEventDispatcher($originalDispatcher); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | public static function containsAll($haystack, array $needles) |
213 | 213 | { |
214 | 214 | foreach ($needles as $needle) { |
215 | - if (! static::contains($haystack, $needle)) { |
|
215 | + if (!static::contains($haystack, $needle)) { |
|
216 | 216 | return false; |
217 | 217 | } |
218 | 218 | } |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | public static function isUuid($value) |
318 | 318 | { |
319 | - if (! is_string($value)) { |
|
319 | + if (!is_string($value)) { |
|
320 | 320 | return false; |
321 | 321 | } |
322 | 322 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | { |
391 | 391 | preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches); |
392 | 392 | |
393 | - if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) { |
|
393 | + if (!isset($matches[0]) || static::length($value) === static::length($matches[0])) { |
|
394 | 394 | return $value; |
395 | 395 | } |
396 | 396 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | { |
463 | 463 | preg_match($pattern, $subject, $matches); |
464 | 464 | |
465 | - if (! $matches) { |
|
465 | + if (!$matches) { |
|
466 | 466 | return ''; |
467 | 467 | } |
468 | 468 | |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | return static::$snakeCache[$key][$delimiter]; |
818 | 818 | } |
819 | 819 | |
820 | - if (! ctype_lower($value)) { |
|
820 | + if (!ctype_lower($value)) { |
|
821 | 821 | $value = preg_replace('/\s+/u', '', ucwords($value)); |
822 | 822 | |
823 | 823 | $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value)); |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | |
861 | 861 | $words = explode(' ', static::replace(['-', '_'], ' ', $value)); |
862 | 862 | |
863 | - $studlyWords = array_map(function ($word) { |
|
863 | + $studlyWords = array_map(function($word) { |
|
864 | 864 | return static::ucfirst($word); |
865 | 865 | }, $words); |
866 | 866 | |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | */ |
892 | 892 | public static function substrCount($haystack, $needle, $offset = 0, $length = null) |
893 | 893 | { |
894 | - if (! is_null($length)) { |
|
894 | + if (!is_null($length)) { |
|
895 | 895 | return substr_count($haystack, $needle, $offset, $length); |
896 | 896 | } else { |
897 | 897 | return substr_count($haystack, $needle, $offset); |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | * @param array $config |
204 | 204 | * @param array $default_config |
205 | 205 | */ |
206 | - private function setAccountConfig($key, $config, $default_config){ |
|
206 | + private function setAccountConfig($key, $config, $default_config) { |
|
207 | 207 | $value = $this->default_account_config[$key]; |
208 | - if(isset($config[$key])) { |
|
208 | + if (isset($config[$key])) { |
|
209 | 209 | $value = $config[$key]; |
210 | - }elseif(isset($default_config[$key])) { |
|
210 | + }elseif (isset($default_config[$key])) { |
|
211 | 211 | $value = $default_config[$key]; |
212 | 212 | } |
213 | 213 | $this->$key = $value; |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | */ |
220 | 220 | protected function setEventsFromConfig($config) { |
221 | 221 | $this->events = ClientManager::get("events"); |
222 | - if(isset($config['events'])){ |
|
223 | - foreach($config['events'] as $section => $events) { |
|
222 | + if (isset($config['events'])) { |
|
223 | + foreach ($config['events'] as $section => $events) { |
|
224 | 224 | $this->events[$section] = array_merge($this->events[$section], $events); |
225 | 225 | } |
226 | 226 | } |
@@ -233,45 +233,45 @@ discard block |
||
233 | 233 | * @throws MaskNotFoundException |
234 | 234 | */ |
235 | 235 | protected function setMaskFromConfig($config) { |
236 | - $default_config = ClientManager::get("masks"); |
|
236 | + $default_config = ClientManager::get("masks"); |
|
237 | 237 | |
238 | - if(isset($config['masks'])){ |
|
239 | - if(isset($config['masks']['message'])) { |
|
240 | - if(class_exists($config['masks']['message'])) { |
|
238 | + if (isset($config['masks'])) { |
|
239 | + if (isset($config['masks']['message'])) { |
|
240 | + if (class_exists($config['masks']['message'])) { |
|
241 | 241 | $this->default_message_mask = $config['masks']['message']; |
242 | - }else{ |
|
242 | + } else { |
|
243 | 243 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['message']); |
244 | 244 | } |
245 | - }else{ |
|
246 | - if(class_exists($default_config['message'])) { |
|
245 | + } else { |
|
246 | + if (class_exists($default_config['message'])) { |
|
247 | 247 | $this->default_message_mask = $default_config['message']; |
248 | - }else{ |
|
248 | + } else { |
|
249 | 249 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']); |
250 | 250 | } |
251 | 251 | } |
252 | - if(isset($config['masks']['attachment'])) { |
|
253 | - if(class_exists($config['masks']['attachment'])) { |
|
252 | + if (isset($config['masks']['attachment'])) { |
|
253 | + if (class_exists($config['masks']['attachment'])) { |
|
254 | 254 | $this->default_attachment_mask = $config['masks']['attachment']; |
255 | - }else{ |
|
255 | + } else { |
|
256 | 256 | throw new MaskNotFoundException("Unknown mask provided: ".$config['masks']['attachment']); |
257 | 257 | } |
258 | - }else{ |
|
259 | - if(class_exists($default_config['attachment'])) { |
|
258 | + } else { |
|
259 | + if (class_exists($default_config['attachment'])) { |
|
260 | 260 | $this->default_attachment_mask = $default_config['attachment']; |
261 | - }else{ |
|
261 | + } else { |
|
262 | 262 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']); |
263 | 263 | } |
264 | 264 | } |
265 | - }else{ |
|
266 | - if(class_exists($default_config['message'])) { |
|
265 | + } else { |
|
266 | + if (class_exists($default_config['message'])) { |
|
267 | 267 | $this->default_message_mask = $default_config['message']; |
268 | - }else{ |
|
268 | + } else { |
|
269 | 269 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['message']); |
270 | 270 | } |
271 | 271 | |
272 | - if(class_exists($default_config['attachment'])) { |
|
272 | + if (class_exists($default_config['attachment'])) { |
|
273 | 273 | $this->default_attachment_mask = $default_config['attachment']; |
274 | - }else{ |
|
274 | + } else { |
|
275 | 275 | throw new MaskNotFoundException("Unknown mask provided: ".$default_config['attachment']); |
276 | 276 | } |
277 | 277 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $this->connection = new ImapProtocol($this->validate_cert, $this->encryption); |
336 | 336 | $this->connection->setConnectionTimeout($this->timeout); |
337 | 337 | $this->connection->setProxy($this->proxy); |
338 | - }else{ |
|
338 | + } else { |
|
339 | 339 | if (extension_loaded('imap') === false) { |
340 | 340 | throw new ConnectionFailedException("connection setup failed - no imap function", 0, new ProtocolNotSupportedException($protocol." is an unsupported protocol")); |
341 | 341 | } |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | |
410 | 410 | // Set delimiter to false to force selection via getFolderByName (maybe useful for uncommon folder names) |
411 | 411 | $delimiter = is_null($delimiter) ? ClientManager::get('options.delimiter', "/") : $delimiter; |
412 | - if (strpos($folder_name, (string)$delimiter) !== false) { |
|
412 | + if (strpos($folder_name, (string) $delimiter) !== false) { |
|
413 | 413 | return $this->getFolderByPath($folder_name); |
414 | 414 | } |
415 | 415 | |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $pattern = $parent_folder.($hierarchical ? '%' : '*'); |
462 | 462 | $items = $this->connection->folders('', $pattern); |
463 | 463 | |
464 | - if(is_array($items)){ |
|
464 | + if (is_array($items)) { |
|
465 | 465 | foreach ($items as $folder_name => $item) { |
466 | 466 | $folder = new Folder($this, $folder_name, $item["delimiter"], $item["flags"]); |
467 | 467 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | } |
477 | 477 | |
478 | 478 | return $folders; |
479 | - }else{ |
|
479 | + } else { |
|
480 | 480 | throw new FolderFetchingException("failed to fetch any folders"); |
481 | 481 | } |
482 | 482 | } |
@@ -514,10 +514,10 @@ discard block |
||
514 | 514 | $this->checkConnection(); |
515 | 515 | $status = $this->connection->createFolder($folder); |
516 | 516 | |
517 | - if($expunge) $this->expunge(); |
|
517 | + if ($expunge) $this->expunge(); |
|
518 | 518 | |
519 | 519 | $folder = $this->getFolder($folder); |
520 | - if($status && $folder) { |
|
520 | + if ($status && $folder) { |
|
521 | 521 | $event = $this->getEvent("folder", "new"); |
522 | 522 | $event::dispatch($folder); |
523 | 523 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | * |
544 | 544 | * @return string |
545 | 545 | */ |
546 | - public function getFolderPath(){ |
|
546 | + public function getFolderPath() { |
|
547 | 547 | return $this->active_folder; |
548 | 548 | } |
549 | 549 | |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | * @return int |
602 | 602 | * @throws ConnectionFailedException |
603 | 603 | */ |
604 | - public function getTimeout(){ |
|
604 | + public function getTimeout() { |
|
605 | 605 | $this->checkConnection(); |
606 | 606 | return $this->connection->getConnectionTimeout(); |
607 | 607 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | * |
612 | 612 | * @return string |
613 | 613 | */ |
614 | - public function getDefaultMessageMask(){ |
|
614 | + public function getDefaultMessageMask() { |
|
615 | 615 | return $this->default_message_mask; |
616 | 616 | } |
617 | 617 | |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | * |
622 | 622 | * @return array |
623 | 623 | */ |
624 | - public function getDefaultEvents($section){ |
|
624 | + public function getDefaultEvents($section) { |
|
625 | 625 | return $this->events[$section]; |
626 | 626 | } |
627 | 627 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * @throws MaskNotFoundException |
634 | 634 | */ |
635 | 635 | public function setDefaultMessageMask($mask) { |
636 | - if(class_exists($mask)) { |
|
636 | + if (class_exists($mask)) { |
|
637 | 637 | $this->default_message_mask = $mask; |
638 | 638 | |
639 | 639 | return $this; |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | * |
648 | 648 | * @return string |
649 | 649 | */ |
650 | - public function getDefaultAttachmentMask(){ |
|
650 | + public function getDefaultAttachmentMask() { |
|
651 | 651 | return $this->default_attachment_mask; |
652 | 652 | } |
653 | 653 | |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | * @throws MaskNotFoundException |
660 | 660 | */ |
661 | 661 | public function setDefaultAttachmentMask($mask) { |
662 | - if(class_exists($mask)) { |
|
662 | + if (class_exists($mask)) { |
|
663 | 663 | $this->default_attachment_mask = $mask; |
664 | 664 | |
665 | 665 | return $this; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | $this->setDelimiter($delimiter); |
124 | 124 | $this->path = $folder_name; |
125 | - $this->full_name = $this->decodeName($folder_name); |
|
125 | + $this->full_name = $this->decodeName($folder_name); |
|
126 | 126 | $this->name = $this->getSimpleName($this->delimiter, $this->full_name); |
127 | 127 | |
128 | 128 | $this->parseAttributes($attributes); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @throws Exceptions\ConnectionFailedException |
137 | 137 | * @throws Exceptions\RuntimeException |
138 | 138 | */ |
139 | - public function query($charset = 'UTF-8'){ |
|
139 | + public function query($charset = 'UTF-8') { |
|
140 | 140 | $this->getClient()->checkConnection(); |
141 | 141 | $this->getClient()->openFolder($this->path); |
142 | 142 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @throws Exceptions\ConnectionFailedException |
149 | 149 | * @throws Exceptions\RuntimeException |
150 | 150 | */ |
151 | - public function search($charset = 'UTF-8'){ |
|
151 | + public function search($charset = 'UTF-8') { |
|
152 | 152 | return $this->query($charset); |
153 | 153 | } |
154 | 154 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * @throws Exceptions\ConnectionFailedException |
158 | 158 | * @throws Exceptions\RuntimeException |
159 | 159 | */ |
160 | - public function messages($charset = 'UTF-8'){ |
|
160 | + public function messages($charset = 'UTF-8') { |
|
161 | 161 | return $this->query($charset); |
162 | 162 | } |
163 | 163 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | public function move($new_name, $expunge = true) { |
233 | 233 | $this->client->checkConnection(); |
234 | 234 | $status = $this->client->getConnection()->renameFolder($this->full_name, $new_name); |
235 | - if($expunge) $this->client->expunge(); |
|
235 | + if ($expunge) $this->client->expunge(); |
|
236 | 236 | |
237 | 237 | $folder = $this->client->getFolder($new_name); |
238 | 238 | $event = $this->getEvent("folder", "moved"); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @throws Exceptions\MessageNotFoundException |
252 | 252 | * @throws Exceptions\RuntimeException |
253 | 253 | */ |
254 | - public function overview($sequence = null){ |
|
254 | + public function overview($sequence = null) { |
|
255 | 255 | $this->client->openFolder($this->path); |
256 | 256 | $sequence = $sequence === null ? "1:*" : $sequence; |
257 | 257 | $uid = ClientManager::get('options.sequence', IMAP::ST_MSGN) == IMAP::ST_UID; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | |
278 | 278 | if ($internal_date != null) { |
279 | - if ($internal_date instanceof Carbon){ |
|
279 | + if ($internal_date instanceof Carbon) { |
|
280 | 280 | $internal_date = $internal_date->format('d-M-Y H:i:s O'); |
281 | 281 | } |
282 | 282 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function delete($expunge = true) { |
312 | 312 | $status = $this->client->getConnection()->deleteFolder($this->path); |
313 | - if($expunge) $this->client->expunge(); |
|
313 | + if ($expunge) $this->client->expunge(); |
|
314 | 314 | |
315 | 315 | $event = $this->getEvent("folder", "deleted"); |
316 | 316 | $event::dispatch($this); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | try { |
372 | 372 | $line = $connection->nextLine(); |
373 | 373 | if (($pos = strpos($line, "EXISTS")) !== false) { |
374 | - $msgn = (int) substr($line, 2, $pos -2); |
|
374 | + $msgn = (int) substr($line, 2, $pos - 2); |
|
375 | 375 | $connection->done(); |
376 | 376 | |
377 | 377 | $this->client->openFolder($this->path, true); |
@@ -384,8 +384,8 @@ discard block |
||
384 | 384 | |
385 | 385 | $connection->idle(); |
386 | 386 | } |
387 | - }catch (Exceptions\RuntimeException $e) { |
|
388 | - if(strpos($e->getMessage(), "connection closed") === false) { |
|
387 | + } catch (Exceptions\RuntimeException $e) { |
|
388 | + if (strpos($e->getMessage(), "connection closed") === false) { |
|
389 | 389 | throw $e; |
390 | 390 | } |
391 | 391 | if ($auto_reconnect === true) { |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | * Set the delimiter |
435 | 435 | * @param $delimiter |
436 | 436 | */ |
437 | - public function setDelimiter($delimiter){ |
|
438 | - if(in_array($delimiter, [null, '', ' ', false]) === true) { |
|
437 | + public function setDelimiter($delimiter) { |
|
438 | + if (in_array($delimiter, [null, '', ' ', false]) === true) { |
|
439 | 439 | $delimiter = ClientManager::get('options.delimiter', '/'); |
440 | 440 | } |
441 | 441 |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | throw new AuthFailedException($message); |
90 | 90 | } |
91 | 91 | |
92 | - if(!$this->stream) { |
|
92 | + if (!$this->stream) { |
|
93 | 93 | $errors = \imap_errors(); |
94 | 94 | $message = implode("; ", (is_array($errors) ? $errors : array())); |
95 | 95 | throw new AuthFailedException($message); |
96 | 96 | } |
97 | 97 | |
98 | 98 | $errors = \imap_errors(); |
99 | - if(is_array($errors)) { |
|
99 | + if (is_array($errors)) { |
|
100 | 100 | $status = $this->examineFolder(); |
101 | - if($status['exists'] !== 0) { |
|
101 | + if ($status['exists'] !== 0) { |
|
102 | 102 | $message = implode("; ", (is_array($errors) ? $errors : array())); |
103 | 103 | throw new RuntimeException($message); |
104 | 104 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | if (!$this->cert_validation) { |
130 | 130 | $address .= '/novalidate-cert'; |
131 | 131 | } |
132 | - if (in_array($this->encryption,['tls', 'notls', 'ssl'])) { |
|
132 | + if (in_array($this->encryption, ['tls', 'notls', 'ssl'])) { |
|
133 | 133 | $address .= '/'.$this->encryption; |
134 | 134 | } elseif ($this->encryption === "starttls") { |
135 | 135 | $address .= '/tls'; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * |
160 | 160 | * @return bool |
161 | 161 | */ |
162 | - public function connected(){ |
|
162 | + public function connected() { |
|
163 | 163 | return boolval($this->stream); |
164 | 164 | } |
165 | 165 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @return array |
233 | 233 | */ |
234 | - public function headers($uids, $rfc = "RFC822", $uid = false){ |
|
234 | + public function headers($uids, $rfc = "RFC822", $uid = false) { |
|
235 | 235 | $result = []; |
236 | 236 | $uids = is_array($uids) ? $uids : [$uids]; |
237 | 237 | foreach ($uids as $id) { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * |
248 | 248 | * @return array |
249 | 249 | */ |
250 | - public function flags($uids, $uid = false){ |
|
250 | + public function flags($uids, $uid = false) { |
|
251 | 251 | $result = []; |
252 | 252 | $uids = is_array($uids) ? $uids : [$uids]; |
253 | 253 | foreach ($uids as $id) { |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | $flags = []; |
256 | 256 | if (is_array($raw_flags) && isset($raw_flags[0])) { |
257 | 257 | $raw_flags = (array) $raw_flags[0]; |
258 | - foreach($raw_flags as $flag => $value) { |
|
259 | - if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false){ |
|
258 | + foreach ($raw_flags as $flag => $value) { |
|
259 | + if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false) { |
|
260 | 260 | $flags[] = "\\".ucfirst($flag); |
261 | 261 | } |
262 | 262 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | if ($id === null) { |
278 | 278 | $overview = $this->overview("1:*"); |
279 | 279 | $uids = []; |
280 | - foreach($overview as $set){ |
|
280 | + foreach ($overview as $set) { |
|
281 | 281 | $uids[$set->msgno] = $set->uid; |
282 | 282 | } |
283 | 283 | return $uids; |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * @return array |
304 | 304 | */ |
305 | 305 | public function overview($sequence, $uid = false) { |
306 | - return \imap_fetch_overview($this->stream, $sequence,$uid ? IMAP::FT_UID : IMAP::NIL); |
|
306 | + return \imap_fetch_overview($this->stream, $sequence, $uid ? IMAP::FT_UID : IMAP::NIL); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -318,12 +318,12 @@ discard block |
||
318 | 318 | $result = []; |
319 | 319 | |
320 | 320 | $items = \imap_getmailboxes($this->stream, $this->getAddress(), $reference.$folder); |
321 | - if(is_array($items)){ |
|
321 | + if (is_array($items)) { |
|
322 | 322 | foreach ($items as $item) { |
323 | 323 | $name = $this->decodeFolderName($item->name); |
324 | 324 | $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; |
325 | 325 | } |
326 | - }else{ |
|
326 | + } else { |
|
327 | 327 | throw new RuntimeException(\imap_last_error()); |
328 | 328 | } |
329 | 329 | |
@@ -345,9 +345,9 @@ discard block |
||
345 | 345 | public function store(array $flags, $from, $to = null, $mode = null, $silent = true, $uid = false) { |
346 | 346 | $flag = trim(is_array($flags) ? implode(" ", $flags) : $flags); |
347 | 347 | |
348 | - if ($mode == "+"){ |
|
348 | + if ($mode == "+") { |
|
349 | 349 | $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
350 | - }else{ |
|
350 | + } else { |
|
351 | 351 | $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::FT_UID : IMAP::NIL); |
352 | 352 | } |
353 | 353 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | */ |
370 | 370 | public function appendMessage($folder, $message, $flags = null, $date = null) { |
371 | 371 | if ($date != null) { |
372 | - if ($date instanceof \Carbon\Carbon){ |
|
372 | + if ($date instanceof \Carbon\Carbon) { |
|
373 | 373 | $date = $date->format('d-M-Y H:i:s O'); |
374 | 374 | } |
375 | 375 | return \imap_append($this->stream, $folder, $message, $flags, $date); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | * @return array|bool Tokens if operation successful, false if an error occurred |
402 | 402 | */ |
403 | 403 | public function copyManyMessages($messages, $folder, $uid = false) { |
404 | - foreach($messages as $msg) { |
|
404 | + foreach ($messages as $msg) { |
|
405 | 405 | if ($this->copyMessage($folder, $msg, null, $uid) == false) { |
406 | 406 | return false; |
407 | 407 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | * @return array|bool Tokens if operation successful, false if an error occurred |
434 | 434 | */ |
435 | 435 | public function moveManyMessages($messages, $folder, $uid = false) { |
436 | - foreach($messages as $msg) { |
|
436 | + foreach ($messages as $msg) { |
|
437 | 437 | if ($this->moveMessage($folder, $msg, null, $uid) == false) { |
438 | 438 | return false; |
439 | 439 | } |
@@ -542,14 +542,14 @@ discard block |
||
542 | 542 | /** |
543 | 543 | * Enable the debug mode |
544 | 544 | */ |
545 | - public function enableDebug(){ |
|
545 | + public function enableDebug() { |
|
546 | 546 | $this->debug = true; |
547 | 547 | } |
548 | 548 | |
549 | 549 | /** |
550 | 550 | * Disable the debug mode |
551 | 551 | */ |
552 | - public function disableDebug(){ |
|
552 | + public function disableDebug() { |
|
553 | 553 | $this->debug = false; |
554 | 554 | } |
555 | 555 |