Passed
Push — master ( aa1d71...aaf84d )
by Sergey
02:39
created
src/PhpConsole/Dispatcher.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,11 +89,9 @@
 block discarded – undo
89 89
 				foreach($call['args'] as $arg) {
90 90
 					if(is_object($arg)) {
91 91
 						$args[] = get_class($arg);
92
-					}
93
-					elseif(is_array($arg)) {
92
+					} elseif(is_array($arg)) {
94 93
 						$args[] = 'Array[' . count($arg) . ']';
95
-					}
96
-					else {
94
+					} else {
97 95
 						$arg = var_export($arg, 1);
98 96
 						$args[] = strlen($arg) > 15 ? substr($arg, 0, 15) . '...\'' : $arg;
99 97
 					}
Please login to merge, or discard this patch.
src/PhpConsole/Dumper.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
 				$nullPos = strrpos($key, chr(0));
81 81
 				if($nullPos) {
82 82
 					$dataArray[substr($key, $nullPos + 1)] = $value;
83
-				}
84
-				else {
83
+				} else {
85 84
 					$dataArray[$key] = $value;
86 85
 				}
87 86
 			}
@@ -114,18 +113,15 @@  discard block
 block discarded – undo
114 113
 						$hash = spl_object_hash($v);
115 114
 						if(in_array($hash, $objectsHashes)) {
116 115
 							$v = '*RECURSION*';
117
-						}
118
-						else {
116
+						} else {
119 117
 							$v = '(object)';
120 118
 							$objectsHashes[] = $hash;
121 119
 						}
122
-					}
123
-					else {
120
+					} else {
124 121
 						$v = '(array)';
125 122
 					}
126 123
 					$sizeLeft -= strlen($k) + strlen($v) + 8;
127
-				}
128
-				else {
124
+				} else {
129 125
 					$sizeLeft -= strlen($k) + 4;
130 126
 					$this->dumpVarData($v, $levelLimit - 1, false);
131 127
 				}
Please login to merge, or discard this patch.
src/PhpConsole/Connector.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -393,8 +393,7 @@
 block discarded – undo
393 393
 			}
394 394
 			if($isMbString) {
395 395
 				$string = @mb_convert_encoding($string, $toEncoding, $fromEncoding) ? : $string;
396
-			}
397
-			else {
396
+			} else {
398 397
 				$string = @iconv($fromEncoding, $toEncoding . '//IGNORE', $string) ? : $string;
399 398
 			}
400 399
 			if(!$string && $toEncoding == 'UTF-8') {
Please login to merge, or discard this patch.
src/PhpConsole/Handler.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -224,11 +224,9 @@
 block discarded – undo
224 224
 			if($this->oldExceptionsHandler && $this->callOldHandlers) {
225 225
 				call_user_func($this->oldExceptionsHandler, $exception);
226 226
 			}
227
-		}
228
-		catch(\Throwable $internalException) {
227
+		} catch(\Throwable $internalException) {
229 228
 			$this->handleException($internalException);
230
-		}
231
-		catch(\Exception $internalException) {
229
+		} catch(\Exception $internalException) {
232 230
 			$this->handleException($internalException);
233 231
 		}
234 232
 		$this->onHandlingComplete();
Please login to merge, or discard this patch.
src/PhpConsole/EvalProvider.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,11 +40,9 @@  discard block
 block discarded – undo
40 40
 		$startTime = microtime(true);
41 41
 		try {
42 42
 			$result->return = static::executeCode($code, $this->sharedVars);
43
-		}
44
-		catch(\Throwable $exception) {
43
+		} catch(\Throwable $exception) {
45 44
 			$result->exception = $exception;
46
-		}
47
-		catch(\Exception $exception) {
45
+		} catch(\Exception $exception) {
48 46
 			$result->exception = $exception;
49 47
 		}
50 48
 		$result->time = abs(microtime(true) - $startTime - $selfTime);
@@ -115,8 +113,7 @@  discard block
 block discarded – undo
115 113
 		foreach($_sharedVars as $var => $value) {
116 114
 			if(isset($GLOBALS[$var]) && $var[0] == '_') { // extract($this->sharedVars, EXTR_OVERWRITE) and $$var = $value do not overwrites global vars
117 115
 				$GLOBALS[$var] = $value;
118
-			}
119
-			elseif(!isset($$var)) {
116
+			} elseif(!isset($$var)) {
120 117
 				$$var = $value;
121 118
 			}
122 119
 		}
Please login to merge, or discard this patch.
src/PhpConsole/PsrLogger.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,16 +62,13 @@
 block discarded – undo
62 62
 
63 63
 		if(isset(static::$debugLevels[$level])) {
64 64
 			$this->connector->getDebugDispatcher()->dispatchDebug($message, static::$debugLevels[$level], $this->ignoreTraceCalls);
65
-		}
66
-		elseif(isset(static::$errorsLevels[$level])) {
65
+		} elseif(isset(static::$errorsLevels[$level])) {
67 66
 			if(isset($context['exception']) && ($context['exception'] instanceof \Exception || $context['exception'] instanceof \Throwable)) {
68 67
 				$this->connector->getErrorsDispatcher()->dispatchException($context['exception']);
69
-			}
70
-			else {
68
+			} else {
71 69
 				$this->connector->getErrorsDispatcher()->dispatchError(static::$errorsLevels[$level], $message, null, null, $this->ignoreTraceCalls);
72 70
 			}
73
-		}
74
-		else {
71
+		} else {
75 72
 			throw new InvalidArgumentException('Unknown log level "' . $level . '"');
76 73
 		}
77 74
 	}
Please login to merge, or discard this patch.
examples/features/handle_on_redirect.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@
 block discarded – undo
14 14
 	}
15 15
 	$handler->debug('Debug message in redirect №' . $redirectNum);
16 16
 	header('Location: ?num=' . $redirectNum);
17
-}
18
-else {
17
+} else {
19 18
 	$handler->debug('Debug message in current page');
20 19
 	echo '
21 20
 		There was 3 redirects before this page is displayed, and you can see all handled error & debug messages in collapsed blocks in JavaScript Console(Ctrl+Shift+J).
Please login to merge, or discard this patch.
examples/features/handle_errors.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@
 block discarded – undo
30 30
 
31 31
 try {
32 32
 	throw new Exception('Some caught exception');
33
-}
34
-catch(Exception $exception) {
33
+} catch(Exception $exception) {
35 34
 	$handler->handleException($exception);
36 35
 }
37 36
 
Please login to merge, or discard this patch.