@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $this->baseUrl = $baseUrl; |
| 100 | 100 | |
| 101 | 101 | if ($basePath === null) { |
| 102 | - $basePath = __DIR__ . DIRECTORY_SEPARATOR . 'Resources'; |
|
| 102 | + $basePath = __DIR__.DIRECTORY_SEPARATOR.'Resources'; |
|
| 103 | 103 | } |
| 104 | 104 | $this->basePath = $basePath; |
| 105 | 105 | |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) { |
| 795 | 795 | return $uri; |
| 796 | 796 | } |
| 797 | - return rtrim($root, '/') . "/$uri"; |
|
| 797 | + return rtrim($root, '/')."/$uri"; |
|
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | /** |
@@ -904,16 +904,16 @@ discard block |
||
| 904 | 904 | $dumpedContent = ''; |
| 905 | 905 | if ($files) { |
| 906 | 906 | foreach ($files as $file) { |
| 907 | - $dumpedContent .= file_get_contents($file) . "\n"; |
|
| 907 | + $dumpedContent .= file_get_contents($file)."\n"; |
|
| 908 | 908 | } |
| 909 | 909 | } |
| 910 | 910 | if ($content) { |
| 911 | 911 | foreach ($content as $item) { |
| 912 | - $dumpedContent .= $item . "\n"; |
|
| 912 | + $dumpedContent .= $item."\n"; |
|
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | if ($useRequireJs) { |
| 916 | - $dumpedContent = "define('debugbar', ['jquery'], function($){\r\n" . $dumpedContent . "\r\n return PhpDebugBar; \r\n});"; |
|
| 916 | + $dumpedContent = "define('debugbar', ['jquery'], function($){\r\n".$dumpedContent."\r\n return PhpDebugBar; \r\n});"; |
|
| 917 | 917 | } |
| 918 | 918 | if ($targetFilename !== null) { |
| 919 | 919 | file_put_contents($targetFilename, $dumpedContent); |
@@ -937,27 +937,27 @@ discard block |
||
| 937 | 937 | $nonce = $this->getNonceAttribute(); |
| 938 | 938 | |
| 939 | 939 | foreach ($cssFiles as $file) { |
| 940 | - $html .= sprintf('<link rel="stylesheet" type="text/css" href="%s">' . "\n", $file); |
|
| 940 | + $html .= sprintf('<link rel="stylesheet" type="text/css" href="%s">'."\n", $file); |
|
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | foreach ($inlineCss as $content) { |
| 944 | - $html .= sprintf('<style type="text/css">%s</style>' . "\n", $content); |
|
| 944 | + $html .= sprintf('<style type="text/css">%s</style>'."\n", $content); |
|
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | foreach ($jsFiles as $file) { |
| 948 | - $html .= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $file); |
|
| 948 | + $html .= sprintf('<script type="text/javascript" src="%s"></script>'."\n", $file); |
|
| 949 | 949 | } |
| 950 | 950 | |
| 951 | 951 | foreach ($inlineJs as $content) { |
| 952 | - $html .= sprintf('<script type="text/javascript"%s>%s</script>' . "\n", $nonce, $content); |
|
| 952 | + $html .= sprintf('<script type="text/javascript"%s>%s</script>'."\n", $nonce, $content); |
|
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | foreach ($inlineHead as $content) { |
| 956 | - $html .= $content . "\n"; |
|
| 956 | + $html .= $content."\n"; |
|
| 957 | 957 | } |
| 958 | 958 | |
| 959 | 959 | if ($this->enableJqueryNoConflict && !$this->useRequireJs) { |
| 960 | - $html .= '<script type="text/javascript"' . $nonce . '>jQuery.noConflict(true);</script>' . "\n"; |
|
| 960 | + $html .= '<script type="text/javascript"'.$nonce.'>jQuery.noConflict(true);</script>'."\n"; |
|
| 961 | 961 | } |
| 962 | 962 | |
| 963 | 963 | return $html; |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | |
| 1047 | 1047 | $nonce = $this->getNonceAttribute(); |
| 1048 | 1048 | |
| 1049 | - if ($this->useRequireJs){ |
|
| 1049 | + if ($this->useRequireJs) { |
|
| 1050 | 1050 | return "<script type=\"text/javascript\"{$nonce}>\nrequire(['debugbar'], function(PhpDebugBar){ $js });\n</script>\n"; |
| 1051 | 1051 | } else { |
| 1052 | 1052 | return "<script type=\"text/javascript\"{$nonce}>\n$js\n</script>\n"; |
@@ -1178,7 +1178,7 @@ discard block |
||
| 1178 | 1178 | $this->variableName, |
| 1179 | 1179 | json_encode($data), |
| 1180 | 1180 | $requestId, |
| 1181 | - $suffix ? ", " . json_encode($suffix) : '' |
|
| 1181 | + $suffix ? ", ".json_encode($suffix) : '' |
|
| 1182 | 1182 | ); |
| 1183 | 1183 | return $js; |
| 1184 | 1184 | } |
@@ -1190,7 +1190,7 @@ discard block |
||
| 1190 | 1190 | protected function getNonceAttribute() |
| 1191 | 1191 | { |
| 1192 | 1192 | if ($nonce = $this->getCspNonce()) { |
| 1193 | - return ' nonce="' . $nonce .'"'; |
|
| 1193 | + return ' nonce="'.$nonce.'"'; |
|
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | return ''; |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | if (function_exists('random_bytes')) { |
| 26 | 26 | // PHP 7 only |
| 27 | - return 'X' . bin2hex(random_bytes(16)); |
|
| 27 | + return 'X'.bin2hex(random_bytes(16)); |
|
| 28 | 28 | } else if (function_exists('openssl_random_pseudo_bytes')) { |
| 29 | 29 | // PHP >= 5.3.0, but OpenSSL may not always be available |
| 30 | - return 'X' . bin2hex(openssl_random_pseudo_bytes(16)); |
|
| 30 | + return 'X'.bin2hex(openssl_random_pseudo_bytes(16)); |
|
| 31 | 31 | } else { |
| 32 | 32 | // Fall back to a rudimentary ID generator: |
| 33 | 33 | // * $_SERVER array will make the ID unique to this request. |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | // * uniqid('', true) will use the current microtime(), plus additional random data. |
| 37 | 37 | // * $this->index guarantees the uniqueness of IDs from the current object. |
| 38 | 38 | $this->index++; |
| 39 | - $entropy = serialize($_SERVER) . uniqid('', true) . spl_object_hash($this) . $this->index; |
|
| 40 | - return 'X' . md5($entropy); |
|
| 39 | + $entropy = serialize($_SERVER).uniqid('', true).spl_object_hash($this).$this->index; |
|
| 40 | + return 'X'.md5($entropy); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | // Remove all invalid (non UTF-8) characters |
| 242 | - array_walk_recursive($this->data, function (&$item) { |
|
| 242 | + array_walk_recursive($this->data, function(&$item) { |
|
| 243 | 243 | if (is_string($item) && !mb_check_encoding($item, 'UTF-8')) { |
| 244 | 244 | $item = mb_convert_encoding($item, 'UTF-8', 'UTF-8'); |
| 245 | 245 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $headers = array(); |
| 299 | 299 | for ($i = 0, $c = count($chunks); $i < $c; $i++) { |
| 300 | - $name = $headerName . ($i > 0 ? "-$i" : ''); |
|
| 300 | + $name = $headerName.($i > 0 ? "-$i" : ''); |
|
| 301 | 301 | $headers[$name] = $chunks[$i]; |
| 302 | 302 | } |
| 303 | 303 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $requestStartTime = microtime(true); |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | - $this->requestStartTime = (float)$requestStartTime; |
|
| 53 | + $this->requestStartTime = (float) $requestStartTime; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | foreach ($vars as $var) { |
| 55 | 55 | if (isset($GLOBALS[$var])) { |
| 56 | - $key = "$" . $var; |
|
| 56 | + $key = "$".$var; |
|
| 57 | 57 | if ($this->isHtmlVarDumperUsed()) { |
| 58 | 58 | $data[$key] = $this->getVarDumper()->renderVar($GLOBALS[$var]); |
| 59 | 59 | } else { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function getAccumulatedStatementsDuration() : float |
| 250 | 250 | { |
| 251 | - return array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getDuration(); }); |
|
| 251 | + return array_reduce($this->executedStatements, function($v, $s) { return $v + $s->getDuration(); }); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function getMemoryUsage() : int |
| 260 | 260 | { |
| 261 | - return array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getMemoryUsage(); }); |
|
| 261 | + return array_reduce($this->executedStatements, function($v, $s) { return $v + $s->getMemoryUsage(); }); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public function getPeakMemoryUsage() : int |
| 270 | 270 | { |
| 271 | - return array_reduce($this->executedStatements, function ($v, $s) { $m = $s->getEndMemory(); return $m > $v ? $m : $v; }); |
|
| 271 | + return array_reduce($this->executedStatements, function($v, $s) { $m = $s->getEndMemory(); return $m > $v ? $m : $v; }); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | public function getFailedExecutedStatements() : array |
| 290 | 290 | { |
| 291 | - return array_filter($this->executedStatements, function ($s) { return !$s->isSuccess(); }); |
|
| 291 | + return array_filter($this->executedStatements, function($s) { return !$s->isSuccess(); }); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $data['memory_usage'] += $pdodata['memory_usage']; |
| 109 | 109 | $data['peak_memory_usage'] = max($data['peak_memory_usage'], $pdodata['peak_memory_usage']); |
| 110 | 110 | $data['statements'] = array_merge($data['statements'], |
| 111 | - array_map(function ($s) use ($name) { $s['connection'] = $name; return $s; }, $pdodata['statements'])); |
|
| 111 | + array_map(function($s) use ($name) { $s['connection'] = $name; return $s; }, $pdodata['statements'])); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | $data['accumulated_duration_str'] = $this->getDataFormatter()->formatDuration($data['accumulated_duration']); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if (empty($connectionName) || $connectionName == 'default') { |
| 132 | 132 | $connectionName = 'pdo'; |
| 133 | 133 | } else { |
| 134 | - $connectionName = 'pdo ' . $connectionName; |
|
| 134 | + $connectionName = 'pdo '.$connectionName; |
|
| 135 | 135 | } |
| 136 | 136 | $stmts = array(); |
| 137 | 137 | foreach ($pdo->getExecutedStatements() as $stmt) { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if (is_numeric($k)) { |
| 122 | 122 | $marker = "\?"; |
| 123 | 123 | } else { |
| 124 | - $marker = (preg_match("/^:/", $k)) ? $k : ":" . $k; |
|
| 124 | + $marker = (preg_match("/^:/", $k)) ? $k : ":".$k; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $matchRule = "/({$marker}(?!\w))(?=(?:[^$quotationChar]|[$quotationChar][^$quotationChar]*[$quotationChar])*$)/"; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $params = []; |
| 160 | 160 | foreach ($this->parameters as $name => $param) { |
| 161 | - $params[$name] = htmlentities($param?:"", ENT_QUOTES, 'UTF-8', false); |
|
| 161 | + $params[$name] = htmlentities($param ?: "", ENT_QUOTES, 'UTF-8', false); |
|
| 162 | 162 | } |
| 163 | 163 | return $params; |
| 164 | 164 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $messages = $this->messages; |
| 162 | 162 | foreach ($this->aggregates as $collector) { |
| 163 | - $msgs = array_map(function ($m) use ($collector) { |
|
| 163 | + $msgs = array_map(function($m) use ($collector) { |
|
| 164 | 164 | $m['collector'] = $collector->getName(); |
| 165 | 165 | return $m; |
| 166 | 166 | }, $collector->getMessages()); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // sort messages by their timestamp |
| 171 | - usort($messages, function ($a, $b) { |
|
| 171 | + usort($messages, function($a, $b) { |
|
| 172 | 172 | if ($a['time'] === $b['time']) { |
| 173 | 173 | return 0; |
| 174 | 174 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | foreach ($context as $key => $val) { |
| 207 | 207 | // check that the value can be cast to string |
| 208 | 208 | if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) { |
| 209 | - $replace['{' . $key . '}'] = $val; |
|
| 209 | + $replace['{'.$key.'}'] = $val; |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |