@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | |
86 | 86 | $backtrace = ($options['reverse'] ? array_reverse(debug_backtrace()) : debug_backtrace()); |
87 | 87 | |
88 | - $output = ''; |
|
88 | + $output = ''; |
|
89 | 89 | $traceIndex = ($options['reverse'] ? 1 : count($backtrace)); |
90 | 90 | foreach ($backtrace as $trace) { |
91 | - $output .= $traceIndex . ': '; |
|
91 | + $output .= $traceIndex.': '; |
|
92 | 92 | $output .= self::getCalledFromTrace($trace); |
93 | 93 | $output .= "\n"; |
94 | 94 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $data .= "\n"; |
116 | 116 | } |
117 | 117 | |
118 | - $data .= 'class ' . $reflectionClass->name . '{'; |
|
118 | + $data .= 'class '.$reflectionClass->name.'{'; |
|
119 | 119 | $firstElement = true; |
120 | 120 | foreach ($reflectionClass->getProperties() as $reflectionProperty) { |
121 | 121 | if (!$firstElement) { |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | $data .= ($reflectionProperty->isPrivate() ? 'private ' : ''); |
172 | 172 | $data .= ($reflectionProperty->isProtected() ? 'protected ' : ''); |
173 | 173 | $data .= ($reflectionProperty->isStatic() ? 'static ' : ''); |
174 | - $data .= '$' . $reflectionProperty->name; |
|
174 | + $data .= '$'.$reflectionProperty->name; |
|
175 | 175 | if (isset($defaultPropertyValues[$property])) { |
176 | - $data .= ' = ' . self::getDebugInformation($defaultPropertyValues[$property]); |
|
176 | + $data .= ' = '.self::getDebugInformation($defaultPropertyValues[$property]); |
|
177 | 177 | } |
178 | 178 | $data .= ';'; |
179 | 179 | |
@@ -208,15 +208,15 @@ discard block |
||
208 | 208 | $data .= ($reflectionMethod->isPrivate() ? 'private ' : ''); |
209 | 209 | $data .= ($reflectionMethod->isProtected() ? 'protected ' : ''); |
210 | 210 | $data .= ($reflectionMethod->isStatic() ? 'static ' : ''); |
211 | - $data .= 'function ' . $reflectionMethod->name . '('; |
|
211 | + $data .= 'function '.$reflectionMethod->name.'('; |
|
212 | 212 | if ($reflectionMethod->getNumberOfParameters()) { |
213 | 213 | foreach ($reflectionMethod->getParameters() as $reflectionMethodParameterIndex => $reflectionMethodParameter) { |
214 | 214 | $data .= ($reflectionMethodParameterIndex > 0 ? ', ' : ''); |
215 | - $data .= '$' . $reflectionMethodParameter->name; |
|
215 | + $data .= '$'.$reflectionMethodParameter->name; |
|
216 | 216 | if ($reflectionMethodParameter->isDefaultValueAvailable()) { |
217 | 217 | $defaultValue = self::getDebugInformation($reflectionMethodParameter->getDefaultValue()); |
218 | 218 | $defaultValue = str_replace(["\n", "\t"], '', $defaultValue); |
219 | - $data .= ' = ' . $defaultValue; |
|
219 | + $data .= ' = '.$defaultValue; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $backtrace = debug_backtrace(); |
239 | 239 | |
240 | 240 | if (!isset($backtrace[$index])) { |
241 | - return 'Unknown trace with index: ' . $index; |
|
241 | + return 'Unknown trace with index: '.$index; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | return self::getCalledFromTrace($backtrace[$index]); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | // Get file and line number |
254 | 254 | $calledFromFile = ''; |
255 | 255 | if (isset($trace['file'])) { |
256 | - $calledFromFile .= $trace['file'] . ' line ' . $trace['line']; |
|
256 | + $calledFromFile .= $trace['file'].' line '.$trace['line']; |
|
257 | 257 | $calledFromFile = str_replace('\\', '/', $calledFromFile); |
258 | 258 | $calledFromFile = (!empty(self::$documentRoot) ? substr($calledFromFile, strlen(self::$documentRoot)) : $calledFromFile); |
259 | 259 | $calledFromFile = trim($calledFromFile, '/'); |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | if (isset($trace['function'])) { |
265 | 265 | $calledFromFunction .= (isset($trace['class']) ? $trace['class'] : ''); |
266 | 266 | $calledFromFunction .= (isset($trace['type']) ? $trace['type'] : ''); |
267 | - $calledFromFunction .= $trace['function'] . '()'; |
|
267 | + $calledFromFunction .= $trace['function'].'()'; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | // Return called from |
@@ -290,19 +290,19 @@ discard block |
||
290 | 290 | |
291 | 291 | $dataType = gettype($data); |
292 | 292 | |
293 | - $methodName = 'getDebugInformation' . ucfirst(strtolower($dataType)); |
|
293 | + $methodName = 'getDebugInformation'.ucfirst(strtolower($dataType)); |
|
294 | 294 | |
295 | - $result = 'No method found supporting data type: ' . $dataType; |
|
295 | + $result = 'No method found supporting data type: '.$dataType; |
|
296 | 296 | if ($dataType == 'string') { |
297 | 297 | if (php_sapi_name() == 'cli') { |
298 | - $result = '"' . (string) $data . '"'; |
|
298 | + $result = '"'.(string) $data.'"'; |
|
299 | 299 | } else { |
300 | 300 | $result = htmlentities($data); |
301 | 301 | if ($data !== '' && $result === '') { |
302 | 302 | $result = htmlentities(utf8_encode($data)); |
303 | 303 | } |
304 | 304 | |
305 | - $result = '<span style="color: #1299DA;">"</span>' . (string) $result . '<span style="color: #1299DA;">"</span>'; |
|
305 | + $result = '<span style="color: #1299DA;">"</span>'.(string) $result.'<span style="color: #1299DA;">"</span>'; |
|
306 | 306 | } |
307 | 307 | } elseif (method_exists('\Xicrow\PhpDebug\Debugger', $methodName)) { |
308 | 308 | $result = (string) self::$methodName($data, [ |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | |
364 | 364 | $break = $end = null; |
365 | 365 | if (!empty($data)) { |
366 | - $break = "\n" . str_repeat("\t", $options['indent']); |
|
367 | - $end = "\n" . str_repeat("\t", $options['indent'] - 1); |
|
366 | + $break = "\n".str_repeat("\t", $options['indent']); |
|
367 | + $end = "\n".str_repeat("\t", $options['indent'] - 1); |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | $datas = []; |
@@ -376,13 +376,13 @@ discard block |
||
376 | 376 | } elseif ($val !== $data) { |
377 | 377 | $val = static::getDebugInformation($val, $options); |
378 | 378 | } |
379 | - $datas[] = $break . static::getDebugInformation($key) . ' => ' . $val; |
|
379 | + $datas[] = $break.static::getDebugInformation($key).' => '.$val; |
|
380 | 380 | } |
381 | 381 | } else { |
382 | - $datas[] = $break . '[maximum depth reached]'; |
|
382 | + $datas[] = $break.'[maximum depth reached]'; |
|
383 | 383 | } |
384 | 384 | |
385 | - return $debugInfo . implode(',', $datas) . $end . ']'; |
|
385 | + return $debugInfo.implode(',', $datas).$end.']'; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
@@ -397,23 +397,23 @@ discard block |
||
397 | 397 | ], $options); |
398 | 398 | |
399 | 399 | $debugInfo = ''; |
400 | - $debugInfo .= 'object(' . get_class($data) . ') {'; |
|
400 | + $debugInfo .= 'object('.get_class($data).') {'; |
|
401 | 401 | |
402 | - $break = "\n" . str_repeat("\t", $options['indent']); |
|
403 | - $end = "\n" . str_repeat("\t", $options['indent'] - 1); |
|
402 | + $break = "\n".str_repeat("\t", $options['indent']); |
|
403 | + $end = "\n".str_repeat("\t", $options['indent'] - 1); |
|
404 | 404 | |
405 | 405 | if ($options['depth'] > 0 && method_exists($data, '__debugInfo')) { |
406 | 406 | try { |
407 | 407 | $debugArray = static::getDebugInformationArray($data->__debugInfo(), array_merge($options, [ |
408 | 408 | 'depth' => ($options['depth'] - 1), |
409 | 409 | ])); |
410 | - $debugInfo .= substr($debugArray, 1, -1); |
|
410 | + $debugInfo .= substr($debugArray, 1, -1); |
|
411 | 411 | |
412 | - return $debugInfo . $end . '}'; |
|
412 | + return $debugInfo.$end.'}'; |
|
413 | 413 | } catch (\Exception $e) { |
414 | 414 | $message = $e->getMessage(); |
415 | 415 | |
416 | - return $debugInfo . "\n(unable to export object: $message)\n }"; |
|
416 | + return $debugInfo."\n(unable to export object: $message)\n }"; |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $value = static::getDebugInformation($value, array_merge($options, [ |
425 | 425 | 'depth' => ($options['depth'] - 1), |
426 | 426 | ])); |
427 | - $props[] = "$key => " . $value; |
|
427 | + $props[] = "$key => ".$value; |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | $ref = new \ReflectionObject($data); |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | } |
447 | 447 | } |
448 | 448 | |
449 | - $debugInfo .= $break . implode($break, $props) . $end; |
|
449 | + $debugInfo .= $break.implode($break, $props).$end; |
|
450 | 450 | } |
451 | 451 | $debugInfo .= '}'; |
452 | 452 | |
@@ -459,6 +459,6 @@ discard block |
||
459 | 459 | * @return string |
460 | 460 | */ |
461 | 461 | private static function getDebugInformationResource($data) { |
462 | - return (string) $data . ' (' . get_resource_type($data) . ')'; |
|
462 | + return (string) $data.' ('.get_resource_type($data).')'; |
|
463 | 463 | } |
464 | 464 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | // Set correct key for the original item |
102 | 102 | if (strpos($item['key'], '#') === false) { |
103 | 103 | self::$collection[$key] = array_merge($item, [ |
104 | - 'key' => $key . ' #1', |
|
104 | + 'key' => $key.' #1', |
|
105 | 105 | 'count' => $itemCount, |
106 | 106 | ]); |
107 | 107 | } else { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | // Set new key |
114 | - $key = $key . ' #' . $itemCount; |
|
114 | + $key = $key.' #'.$itemCount; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | // Make sure various options are set |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | // Check for key duplicates, and find the last one not stopped |
171 | - if (isset(self::$collection[$key]) && isset(self::$collection[$key . ' #2'])) { |
|
171 | + if (isset(self::$collection[$key]) && isset(self::$collection[$key.' #2'])) { |
|
172 | 172 | $lastNotStopped = false; |
173 | 173 | $currentKey = $key; |
174 | 174 | $currentIndex = 1; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | $currentIndex++; |
181 | - $currentKey = $key . ' #' . $currentIndex; |
|
181 | + $currentKey = $key.' #'.$currentIndex; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | if ($lastNotStopped) { |
@@ -257,21 +257,21 @@ discard block |
||
257 | 257 | if (count($keyArr) > 1) { |
258 | 258 | $method = array_pop($keyArr); |
259 | 259 | $key = implode('/', $keyArr); |
260 | - $key .= '::' . $method; |
|
260 | + $key .= '::'.$method; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | unset($keyArr, $method); |
264 | 264 | } elseif (is_object($callback) && $callback instanceof \Closure) { |
265 | 265 | $key = 'closure'; |
266 | 266 | } |
267 | - $key = 'callback: ' . $key; |
|
267 | + $key = 'callback: '.$key; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | // Set default return value |
271 | 271 | $returnValue = true; |
272 | 272 | |
273 | 273 | // Set error handler, to convert errors to exceptions |
274 | - set_error_handler(function ($errno, $errstr, $errfile, $errline, array $errcontext) { |
|
274 | + set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) { |
|
275 | 275 | throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); |
276 | 276 | }); |
277 | 277 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | ob_end_clean(); |
296 | 296 | |
297 | 297 | // Show error message |
298 | - self::output('Invalid callback sent to Timer::callback: ' . str_replace('callback: ', '', $key)); |
|
298 | + self::output('Invalid callback sent to Timer::callback: '.str_replace('callback: ', '', $key)); |
|
299 | 299 | |
300 | 300 | // Clear the item from the collection |
301 | 301 | unset(self::$collection[$key]); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $stats = self::getStats($key, $options); |
349 | 349 | |
350 | 350 | if (php_sapi_name() == 'cli') { |
351 | - $output .= (!empty($output) ? "\n" : '') . $stats; |
|
351 | + $output .= (!empty($output) ? "\n" : '').$stats; |
|
352 | 352 | } else { |
353 | 353 | $output .= '<div class="xicrow-php-debug-timer">'; |
354 | 354 | $output .= $stats; |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | // If item does not exist |
385 | 385 | if (!isset(self::$collection[$key])) { |
386 | - return 'Unknow item in with key: ' . $key; |
|
386 | + return 'Unknow item in with key: '.$key; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | // Get item |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $outputName .= ($options['nested'] ? str_repeat($options['nested_prefix'], $item['level']) : ''); |
406 | 406 | $outputName .= $item['key']; |
407 | 407 | if (mb_strlen($outputName) > $options['max_key_length']) { |
408 | - $outputName = '~' . mb_substr($item['key'], -($options['max_key_length'] - 1)); |
|
408 | + $outputName = '~'.mb_substr($item['key'], -($options['max_key_length'] - 1)); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | // Add item stats |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | krsort(self::$colorThreshold); |
418 | 418 | foreach (self::$colorThreshold as $value => $color) { |
419 | 419 | if (is_numeric($itemResult) && $itemResult >= $value) { |
420 | - $output = '<span style="color: ' . $color . ';">' . $output . '</span>'; |
|
420 | + $output = '<span style="color: '.$color.';">'.$output.'</span>'; |
|
421 | 421 | } |
422 | 422 | } |
423 | 423 | } |
@@ -467,6 +467,6 @@ discard block |
||
467 | 467 | } |
468 | 468 | } |
469 | 469 | |
470 | - return sprintf('%0.' . $precision . 'f', $value) . ' ' . str_pad($unit, 2, ' ', STR_PAD_RIGHT); |
|
470 | + return sprintf('%0.'.$precision.'f', $value).' '.str_pad($unit, 2, ' ', STR_PAD_RIGHT); |
|
471 | 471 | } |
472 | 472 | } |