@@ -198,8 +198,7 @@ discard block |
||
198 | 198 | $CurrentBlock = $Block; |
199 | 199 | |
200 | 200 | continue; |
201 | - } |
|
202 | - else |
|
201 | + } else |
|
203 | 202 | { |
204 | 203 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
205 | 204 | { |
@@ -258,8 +257,7 @@ discard block |
||
258 | 257 | if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) |
259 | 258 | { |
260 | 259 | $CurrentBlock['element']['text'] .= "\n".$text; |
261 | - } |
|
262 | - else |
|
260 | + } else |
|
263 | 261 | { |
264 | 262 | $Blocks []= $CurrentBlock; |
265 | 263 | |
@@ -764,8 +762,7 @@ discard block |
||
764 | 762 | |
765 | 763 | $Block['void'] = true; |
766 | 764 | } |
767 | - } |
|
768 | - else |
|
765 | + } else |
|
769 | 766 | { |
770 | 767 | if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) |
771 | 768 | { |
@@ -789,18 +786,21 @@ discard block |
||
789 | 786 | return; |
790 | 787 | } |
791 | 788 | |
792 | - if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open |
|
789 | + if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) { |
|
790 | + # open |
|
793 | 791 | { |
794 | 792 | $Block['depth'] ++; |
795 | 793 | } |
794 | + } |
|
796 | 795 | |
797 | - if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close |
|
796 | + if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) { |
|
797 | + # close |
|
798 | 798 | { |
799 | 799 | if ($Block['depth'] > 0) |
800 | 800 | { |
801 | 801 | $Block['depth'] --; |
802 | - } |
|
803 | - else |
|
802 | + } |
|
803 | + } else |
|
804 | 804 | { |
805 | 805 | $Block['closed'] = true; |
806 | 806 | } |
@@ -1190,12 +1190,10 @@ discard block |
||
1190 | 1190 | if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) |
1191 | 1191 | { |
1192 | 1192 | $emphasis = 'strong'; |
1193 | - } |
|
1194 | - elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
1193 | + } elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) |
|
1195 | 1194 | { |
1196 | 1195 | $emphasis = 'em'; |
1197 | - } |
|
1198 | - else |
|
1196 | + } else |
|
1199 | 1197 | { |
1200 | 1198 | return; |
1201 | 1199 | } |
@@ -1279,8 +1277,7 @@ discard block |
||
1279 | 1277 | $extent += strlen($matches[0]); |
1280 | 1278 | |
1281 | 1279 | $remainder = substr($remainder, $extent); |
1282 | - } |
|
1283 | - else |
|
1280 | + } else |
|
1284 | 1281 | { |
1285 | 1282 | return; |
1286 | 1283 | } |
@@ -1295,8 +1292,7 @@ discard block |
||
1295 | 1292 | } |
1296 | 1293 | |
1297 | 1294 | $extent += strlen($matches[0]); |
1298 | - } |
|
1299 | - else |
|
1295 | + } else |
|
1300 | 1296 | { |
1301 | 1297 | if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) |
1302 | 1298 | { |
@@ -1304,8 +1300,7 @@ discard block |
||
1304 | 1300 | $definition = strtolower($definition); |
1305 | 1301 | |
1306 | 1302 | $extent += strlen($matches[0]); |
1307 | - } |
|
1308 | - else |
|
1303 | + } else |
|
1309 | 1304 | { |
1310 | 1305 | $definition = strtolower($Element['text']); |
1311 | 1306 | } |
@@ -1453,8 +1448,7 @@ discard block |
||
1453 | 1448 | if ($this->breaksEnabled) |
1454 | 1449 | { |
1455 | 1450 | $text = preg_replace('/[ ]*\n/', "<br />\n", $text); |
1456 | - } |
|
1457 | - else |
|
1451 | + } else |
|
1458 | 1452 | { |
1459 | 1453 | $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text); |
1460 | 1454 | $text = str_replace(" \n", "\n", $text); |
@@ -1516,19 +1510,16 @@ discard block |
||
1516 | 1510 | if (isset($Element['handler'])) |
1517 | 1511 | { |
1518 | 1512 | $markup .= $this->{$Element['handler']}($text, $Element['nonNestables']); |
1519 | - } |
|
1520 | - elseif (!$permitRawHtml) |
|
1513 | + } elseif (!$permitRawHtml) |
|
1521 | 1514 | { |
1522 | 1515 | $markup .= self::escape($text, true); |
1523 | - } |
|
1524 | - else |
|
1516 | + } else |
|
1525 | 1517 | { |
1526 | 1518 | $markup .= $text; |
1527 | 1519 | } |
1528 | 1520 | |
1529 | 1521 | $markup .= '</'.$Element['name'].'>'; |
1530 | - } |
|
1531 | - else |
|
1522 | + } else |
|
1532 | 1523 | { |
1533 | 1524 | $markup .= ' />'; |
1534 | 1525 | } |
@@ -1646,8 +1637,7 @@ discard block |
||
1646 | 1637 | if ($len > strlen($string)) |
1647 | 1638 | { |
1648 | 1639 | return false; |
1649 | - } |
|
1650 | - else |
|
1640 | + } else |
|
1651 | 1641 | { |
1652 | 1642 | return strtolower(substr($string, 0, $len)) === strtolower($needle); |
1653 | 1643 | } |
@@ -158,10 +158,12 @@ discard block |
||
158 | 158 | * @access private |
159 | 159 | */ |
160 | 160 | function io_method() { |
161 | - if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) |
|
162 | - return 'curl'; |
|
163 | - if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) |
|
164 | - return 'socket'; |
|
161 | + if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) { |
|
162 | + return 'curl'; |
|
163 | + } |
|
164 | + if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) { |
|
165 | + return 'socket'; |
|
166 | + } |
|
165 | 167 | return 'unknown'; |
166 | 168 | } |
167 | 169 | |
@@ -245,30 +247,36 @@ discard block |
||
245 | 247 | return false; |
246 | 248 | } |
247 | 249 | // Avoid warnings when PHP does not have these options |
248 | - if (defined('CURLOPT_CONNECTIONTIMEOUT')) |
|
249 | - $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; |
|
250 | - else |
|
251 | - $CURLOPT_CONNECTIONTIMEOUT = 78; |
|
252 | - if (defined('CURLOPT_HTTPAUTH')) |
|
253 | - $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; |
|
254 | - else |
|
255 | - $CURLOPT_HTTPAUTH = 107; |
|
256 | - if (defined('CURLOPT_PROXYAUTH')) |
|
257 | - $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; |
|
258 | - else |
|
259 | - $CURLOPT_PROXYAUTH = 111; |
|
260 | - if (defined('CURLAUTH_BASIC')) |
|
261 | - $CURLAUTH_BASIC = CURLAUTH_BASIC; |
|
262 | - else |
|
263 | - $CURLAUTH_BASIC = 1; |
|
264 | - if (defined('CURLAUTH_DIGEST')) |
|
265 | - $CURLAUTH_DIGEST = CURLAUTH_DIGEST; |
|
266 | - else |
|
267 | - $CURLAUTH_DIGEST = 2; |
|
268 | - if (defined('CURLAUTH_NTLM')) |
|
269 | - $CURLAUTH_NTLM = CURLAUTH_NTLM; |
|
270 | - else |
|
271 | - $CURLAUTH_NTLM = 8; |
|
250 | + if (defined('CURLOPT_CONNECTIONTIMEOUT')) { |
|
251 | + $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; |
|
252 | + } else { |
|
253 | + $CURLOPT_CONNECTIONTIMEOUT = 78; |
|
254 | + } |
|
255 | + if (defined('CURLOPT_HTTPAUTH')) { |
|
256 | + $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; |
|
257 | + } else { |
|
258 | + $CURLOPT_HTTPAUTH = 107; |
|
259 | + } |
|
260 | + if (defined('CURLOPT_PROXYAUTH')) { |
|
261 | + $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; |
|
262 | + } else { |
|
263 | + $CURLOPT_PROXYAUTH = 111; |
|
264 | + } |
|
265 | + if (defined('CURLAUTH_BASIC')) { |
|
266 | + $CURLAUTH_BASIC = CURLAUTH_BASIC; |
|
267 | + } else { |
|
268 | + $CURLAUTH_BASIC = 1; |
|
269 | + } |
|
270 | + if (defined('CURLAUTH_DIGEST')) { |
|
271 | + $CURLAUTH_DIGEST = CURLAUTH_DIGEST; |
|
272 | + } else { |
|
273 | + $CURLAUTH_DIGEST = 2; |
|
274 | + } |
|
275 | + if (defined('CURLAUTH_NTLM')) { |
|
276 | + $CURLAUTH_NTLM = CURLAUTH_NTLM; |
|
277 | + } else { |
|
278 | + $CURLAUTH_NTLM = 8; |
|
279 | + } |
|
272 | 280 | |
273 | 281 | $this->debug('connect using cURL'); |
274 | 282 | // init CURL |
@@ -611,7 +619,9 @@ discard block |
||
611 | 619 | 'HTTP/1.0 200 Connection established'); |
612 | 620 | foreach ($skipHeaders as $hd) { |
613 | 621 | $prefix = substr($data, 0, strlen($hd)); |
614 | - if ($prefix == $hd) return true; |
|
622 | + if ($prefix == $hd) { |
|
623 | + return true; |
|
624 | + } |
|
615 | 625 | } |
616 | 626 | |
617 | 627 | return false; |
@@ -2309,10 +2309,12 @@ discard block |
||
2309 | 2309 | * @access private |
2310 | 2310 | */ |
2311 | 2311 | function io_method() { |
2312 | - if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) |
|
2313 | - return 'curl'; |
|
2314 | - if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) |
|
2315 | - return 'socket'; |
|
2312 | + if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) { |
|
2313 | + return 'curl'; |
|
2314 | + } |
|
2315 | + if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) { |
|
2316 | + return 'socket'; |
|
2317 | + } |
|
2316 | 2318 | return 'unknown'; |
2317 | 2319 | } |
2318 | 2320 | |
@@ -2396,30 +2398,36 @@ discard block |
||
2396 | 2398 | return false; |
2397 | 2399 | } |
2398 | 2400 | // Avoid warnings when PHP does not have these options |
2399 | - if (defined('CURLOPT_CONNECTIONTIMEOUT')) |
|
2400 | - $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; |
|
2401 | - else |
|
2402 | - $CURLOPT_CONNECTIONTIMEOUT = 78; |
|
2403 | - if (defined('CURLOPT_HTTPAUTH')) |
|
2404 | - $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; |
|
2405 | - else |
|
2406 | - $CURLOPT_HTTPAUTH = 107; |
|
2407 | - if (defined('CURLOPT_PROXYAUTH')) |
|
2408 | - $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; |
|
2409 | - else |
|
2410 | - $CURLOPT_PROXYAUTH = 111; |
|
2411 | - if (defined('CURLAUTH_BASIC')) |
|
2412 | - $CURLAUTH_BASIC = CURLAUTH_BASIC; |
|
2413 | - else |
|
2414 | - $CURLAUTH_BASIC = 1; |
|
2415 | - if (defined('CURLAUTH_DIGEST')) |
|
2416 | - $CURLAUTH_DIGEST = CURLAUTH_DIGEST; |
|
2417 | - else |
|
2418 | - $CURLAUTH_DIGEST = 2; |
|
2419 | - if (defined('CURLAUTH_NTLM')) |
|
2420 | - $CURLAUTH_NTLM = CURLAUTH_NTLM; |
|
2421 | - else |
|
2422 | - $CURLAUTH_NTLM = 8; |
|
2401 | + if (defined('CURLOPT_CONNECTIONTIMEOUT')) { |
|
2402 | + $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT; |
|
2403 | + } else { |
|
2404 | + $CURLOPT_CONNECTIONTIMEOUT = 78; |
|
2405 | + } |
|
2406 | + if (defined('CURLOPT_HTTPAUTH')) { |
|
2407 | + $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH; |
|
2408 | + } else { |
|
2409 | + $CURLOPT_HTTPAUTH = 107; |
|
2410 | + } |
|
2411 | + if (defined('CURLOPT_PROXYAUTH')) { |
|
2412 | + $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH; |
|
2413 | + } else { |
|
2414 | + $CURLOPT_PROXYAUTH = 111; |
|
2415 | + } |
|
2416 | + if (defined('CURLAUTH_BASIC')) { |
|
2417 | + $CURLAUTH_BASIC = CURLAUTH_BASIC; |
|
2418 | + } else { |
|
2419 | + $CURLAUTH_BASIC = 1; |
|
2420 | + } |
|
2421 | + if (defined('CURLAUTH_DIGEST')) { |
|
2422 | + $CURLAUTH_DIGEST = CURLAUTH_DIGEST; |
|
2423 | + } else { |
|
2424 | + $CURLAUTH_DIGEST = 2; |
|
2425 | + } |
|
2426 | + if (defined('CURLAUTH_NTLM')) { |
|
2427 | + $CURLAUTH_NTLM = CURLAUTH_NTLM; |
|
2428 | + } else { |
|
2429 | + $CURLAUTH_NTLM = 8; |
|
2430 | + } |
|
2423 | 2431 | |
2424 | 2432 | $this->debug('connect using cURL'); |
2425 | 2433 | // init CURL |
@@ -2762,7 +2770,9 @@ discard block |
||
2762 | 2770 | 'HTTP/1.0 200 Connection established'); |
2763 | 2771 | foreach ($skipHeaders as $hd) { |
2764 | 2772 | $prefix = substr($data, 0, strlen($hd)); |
2765 | - if ($prefix == $hd) return true; |
|
2773 | + if ($prefix == $hd) { |
|
2774 | + return true; |
|
2775 | + } |
|
2766 | 2776 | } |
2767 | 2777 | |
2768 | 2778 | return false; |
@@ -4656,8 +4666,9 @@ discard block |
||
4656 | 4666 | $this->proxypassword = $proxypassword; |
4657 | 4667 | $this->timeout = $timeout; |
4658 | 4668 | $this->response_timeout = $response_timeout; |
4659 | - if (is_array($curl_options)) |
|
4660 | - $this->curl_options = $curl_options; |
|
4669 | + if (is_array($curl_options)) { |
|
4670 | + $this->curl_options = $curl_options; |
|
4671 | + } |
|
4661 | 4672 | $this->use_curl = $use_curl; |
4662 | 4673 | $this->fetchWSDL($wsdl); |
4663 | 4674 | } |
@@ -7329,8 +7340,9 @@ discard block |
||
7329 | 7340 | } |
7330 | 7341 | if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { |
7331 | 7342 | $this->loadWSDL(); |
7332 | - if ($this->getError()) |
|
7333 | - return false; |
|
7343 | + if ($this->getError()) { |
|
7344 | + return false; |
|
7345 | + } |
|
7334 | 7346 | } |
7335 | 7347 | // serialize parameters |
7336 | 7348 | if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){ |
@@ -7544,8 +7556,9 @@ discard block |
||
7544 | 7556 | function getOperationData($operation){ |
7545 | 7557 | if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { |
7546 | 7558 | $this->loadWSDL(); |
7547 | - if ($this->getError()) |
|
7548 | - return false; |
|
7559 | + if ($this->getError()) { |
|
7560 | + return false; |
|
7561 | + } |
|
7549 | 7562 | } |
7550 | 7563 | if(isset($this->operations[$operation])){ |
7551 | 7564 | return $this->operations[$operation]; |
@@ -77,8 +77,9 @@ |
||
77 | 77 | $this->proxypassword = $proxypassword; |
78 | 78 | $this->timeout = $timeout; |
79 | 79 | $this->response_timeout = $response_timeout; |
80 | - if (is_array($curl_options)) |
|
81 | - $this->curl_options = $curl_options; |
|
80 | + if (is_array($curl_options)) { |
|
81 | + $this->curl_options = $curl_options; |
|
82 | + } |
|
82 | 83 | $this->use_curl = $use_curl; |
83 | 84 | $this->fetchWSDL($wsdl); |
84 | 85 | } |
@@ -172,8 +172,9 @@ discard block |
||
172 | 172 | } |
173 | 173 | if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { |
174 | 174 | $this->loadWSDL(); |
175 | - if ($this->getError()) |
|
176 | - return false; |
|
175 | + if ($this->getError()) { |
|
176 | + return false; |
|
177 | + } |
|
177 | 178 | } |
178 | 179 | // serialize parameters |
179 | 180 | if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){ |
@@ -387,8 +388,9 @@ discard block |
||
387 | 388 | function getOperationData($operation){ |
388 | 389 | if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) { |
389 | 390 | $this->loadWSDL(); |
390 | - if ($this->getError()) |
|
391 | - return false; |
|
391 | + if ($this->getError()) { |
|
392 | + return false; |
|
393 | + } |
|
392 | 394 | } |
393 | 395 | if(isset($this->operations[$operation])){ |
394 | 396 | return $this->operations[$operation]; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $value = $this->default_account_config[$key]; |
208 | 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; |
@@ -239,39 +239,39 @@ discard block |
||
239 | 239 | if(isset($config['masks']['message'])) { |
240 | 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{ |
|
245 | + } else{ |
|
246 | 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 | 252 | if(isset($config['masks']['attachment'])) { |
253 | 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{ |
|
258 | + } else{ |
|
259 | 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{ |
|
265 | + } else{ |
|
266 | 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 | 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 | } |
@@ -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,7 +514,9 @@ discard block |
||
514 | 514 | $this->checkConnection(); |
515 | 515 | $status = $this->connection->createFolder($folder); |
516 | 516 | |
517 | - if($expunge) $this->expunge(); |
|
517 | + if($expunge) { |
|
518 | + $this->expunge(); |
|
519 | + } |
|
518 | 520 | |
519 | 521 | $folder = $this->getFolder($folder); |
520 | 522 | if($status && $folder) { |
@@ -232,7 +232,9 @@ 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) { |
|
236 | + $this->client->expunge(); |
|
237 | + } |
|
236 | 238 | |
237 | 239 | $folder = $this->client->getFolder($new_name); |
238 | 240 | $event = $this->getEvent("folder", "moved"); |
@@ -310,7 +312,9 @@ discard block |
||
310 | 312 | */ |
311 | 313 | public function delete($expunge = true) { |
312 | 314 | $status = $this->client->getConnection()->deleteFolder($this->path); |
313 | - if($expunge) $this->client->expunge(); |
|
315 | + if($expunge) { |
|
316 | + $this->client->expunge(); |
|
317 | + } |
|
314 | 318 | |
315 | 319 | $event = $this->getEvent("folder", "deleted"); |
316 | 320 | $event::dispatch($this); |
@@ -384,7 +388,7 @@ discard block |
||
384 | 388 | |
385 | 389 | $connection->idle(); |
386 | 390 | } |
387 | - }catch (Exceptions\RuntimeException $e) { |
|
391 | + } catch (Exceptions\RuntimeException $e) { |
|
388 | 392 | if(strpos($e->getMessage(), "connection closed") === false) { |
389 | 393 | throw $e; |
390 | 394 | } |
@@ -323,7 +323,7 @@ discard block |
||
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 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 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 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | // so add them back in manually if we can |
73 | 73 | if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { |
74 | 74 | $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; |
75 | - }elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { |
|
75 | + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { |
|
76 | 76 | $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; |
77 | 77 | } |
78 | 78 |