@@ -40,7 +40,7 @@ |
||
| 40 | 40 | continue; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $dump .= $message['message'] . PHP_EOL; |
|
| 43 | + $dump .= $message['message'].PHP_EOL; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $dump; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | public function enter(Twig_Profiler_Profile $profile) |
| 46 | 46 | { |
| 47 | 47 | if ($this->timeDataCollector && $profile->isTemplate()) { |
| 48 | - $this->timeDataCollector->startMeasure($profile->getName(), 'template ' . $profile->getName()); |
|
| 48 | + $this->timeDataCollector->startMeasure($profile->getName(), 'template '.$profile->getName()); |
|
| 49 | 49 | } |
| 50 | 50 | parent::enter($profile); |
| 51 | 51 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $duration = null; |
| 146 | 146 | $memory = null; |
| 147 | 147 | |
| 148 | - $isSuccess = ( LogLevel::INFO === strtolower($record['level_name']) ); |
|
| 148 | + $isSuccess = (LogLevel::INFO === strtolower($record['level_name'])); |
|
| 149 | 149 | |
| 150 | 150 | $detailsCount = count($config['details']); |
| 151 | 151 | $parameters = explode($config['outerGlue'], $record['message'], $detailsCount + 1); |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | $value = $_details[$detail['name']]; |
| 164 | 164 | if ('time' === $key) { |
| 165 | 165 | if (substr_count($value, 'ms')) { |
| 166 | - $value = (float)$value / 1000; |
|
| 166 | + $value = (float) $value / 1000; |
|
| 167 | 167 | } else { |
| 168 | - $value = (float)$value; |
|
| 168 | + $value = (float) $value; |
|
| 169 | 169 | } |
| 170 | 170 | } else { |
| 171 | 171 | $suffixes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $i = array_search($suffix, $suffixes, true); |
| 174 | 174 | $i = (false === $i) ? 0 : $i; |
| 175 | 175 | |
| 176 | - $value = ((float)$value) * pow(1024, $i); |
|
| 176 | + $value = ((float) $value) * pow(1024, $i); |
|
| 177 | 177 | } |
| 178 | 178 | $details[$key] = $value; |
| 179 | 179 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | { |
| 224 | 224 | if (count($this->errors)) { |
| 225 | 225 | return array( |
| 226 | - 'statements' => array_map(function ($message) { |
|
| 226 | + 'statements' => array_map(function($message) { |
|
| 227 | 227 | return array('sql' => '', 'is_success' => false, 'error_code' => 500, 'error_message' => $message); |
| 228 | 228 | }, $this->errors), |
| 229 | 229 | 'nb_statements' => 0, |
@@ -237,15 +237,15 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | $statements = $this->getStatements($this->getHandler()->getRecords(), $this->getConfig()); |
| 239 | 239 | |
| 240 | - $failedStatement = count(array_filter($statements, function ($statement) { |
|
| 240 | + $failedStatement = count(array_filter($statements, function($statement) { |
|
| 241 | 241 | return false === $statement['is_success']; |
| 242 | 242 | })); |
| 243 | - $accumulatedDuration = array_reduce($statements, function ($accumulatedDuration, $statement) { |
|
| 243 | + $accumulatedDuration = array_reduce($statements, function($accumulatedDuration, $statement) { |
|
| 244 | 244 | |
| 245 | 245 | $time = isset($statement['duration']) ? $statement['duration'] : 0; |
| 246 | 246 | return $accumulatedDuration += $time; |
| 247 | 247 | }); |
| 248 | - $memoryUsage = array_reduce($statements, function ($memoryUsage, $statement) { |
|
| 248 | + $memoryUsage = array_reduce($statements, function($memoryUsage, $statement) { |
|
| 249 | 249 | |
| 250 | 250 | $time = isset($statement['memory']) ? $statement['memory'] : 0; |
| 251 | 251 | return $memoryUsage += $time; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | public function getName() |
| 269 | 269 | { |
| 270 | - $additionalName = ''; |
|
| 270 | + $additionalName = ''; |
|
| 271 | 271 | if ($this->getLogger() !== $this->getDefaultLogger()) { |
| 272 | 272 | $additionalName = ' ('.$this->getLogger()->getName().')'; |
| 273 | 273 | } |
@@ -58,14 +58,14 @@ |
||
| 58 | 58 | $config->setParameter('debugpdo.logging.details.time.enabled', true); |
| 59 | 59 | $config->setParameter('debugpdo.logging.details.mem.enabled', true); |
| 60 | 60 | $allMethods = array( |
| 61 | - 'PropelPDO::__construct', // logs connection opening |
|
| 62 | - 'PropelPDO::__destruct', // logs connection close |
|
| 63 | - 'PropelPDO::exec', // logs a query |
|
| 64 | - 'PropelPDO::query', // logs a query |
|
| 65 | - 'PropelPDO::beginTransaction', // logs a transaction begin |
|
| 66 | - 'PropelPDO::commit', // logs a transaction commit |
|
| 67 | - 'PropelPDO::rollBack', // logs a transaction rollBack (watch out for the capital 'B') |
|
| 68 | - 'DebugPDOStatement::execute', // logs a query from a prepared statement |
|
| 61 | + 'PropelPDO::__construct', // logs connection opening |
|
| 62 | + 'PropelPDO::__destruct', // logs connection close |
|
| 63 | + 'PropelPDO::exec', // logs a query |
|
| 64 | + 'PropelPDO::query', // logs a query |
|
| 65 | + 'PropelPDO::beginTransaction', // logs a transaction begin |
|
| 66 | + 'PropelPDO::commit', // logs a transaction commit |
|
| 67 | + 'PropelPDO::rollBack', // logs a transaction rollBack (watch out for the capital 'B') |
|
| 68 | + 'DebugPDOStatement::execute', // logs a query from a prepared statement |
|
| 69 | 69 | ); |
| 70 | 70 | $config->setParameter('debugpdo.logging.methods', $allMethods, false); |
| 71 | 71 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | public function __construct(\Twig_Profiler_Profile $profile, $loaderOrEnv = null) |
| 74 | 74 | { |
| 75 | - $this->profile = $profile; |
|
| 75 | + $this->profile = $profile; |
|
| 76 | 76 | if ($loaderOrEnv instanceof \Twig_Environment) { |
| 77 | 77 | $loaderOrEnv = $loaderOrEnv->getLoader(); |
| 78 | 78 | } |
@@ -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 | /** |