@@ -31,6 +31,6 @@ |
||
31 | 31 | { |
32 | 32 | public function renderValue(Value $o) |
33 | 33 | { |
34 | - return '<dl>'.$this->renderLockedHeader($o, '<var>Blacklisted</var>').'</dl>'; |
|
34 | + return '<dl>' . $this->renderLockedHeader($o, '<var>Blacklisted</var>') . '</dl>'; |
|
35 | 35 | } |
36 | 36 | } |
@@ -40,13 +40,13 @@ |
||
40 | 40 | $lines = \str_split($r->contents, self::$line_length); |
41 | 41 | |
42 | 42 | foreach ($lines as $index => $line) { |
43 | - $out .= \sprintf('%08X', $index * self::$line_length).":\t"; |
|
43 | + $out .= \sprintf('%08X', $index * self::$line_length) . ":\t"; |
|
44 | 44 | |
45 | 45 | /** @var string[] Psalm bug workaround */ |
46 | 46 | $chunks = \str_split(\str_pad(\bin2hex($line), 2 * self::$line_length, ' '), self::$chunk_length); |
47 | 47 | |
48 | 48 | $out .= \implode(' ', $chunks); |
49 | - $out .= "\t".\preg_replace('/[^\\x20-\\x7E]/', '.', $line)."\n"; |
|
49 | + $out .= "\t" . \preg_replace('/[^\\x20-\\x7E]/', '.', $line) . "\n"; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $out .= '</pre>'; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $dt = DateTime::createFromFormat('U', $r->contents); |
37 | 37 | |
38 | 38 | if ($dt) { |
39 | - return '<pre>'.$dt->setTimeZone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s T').'</pre>'; |
|
39 | + return '<pre>' . $dt->setTimeZone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s T') . '</pre>'; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | |
60 | 60 | foreach ($source as $linenum => $line) { |
61 | 61 | if ($linenum === $r->line) { |
62 | - $output .= '<div class="kint-highlight">'.$this->renderer->escape($line)."\n".'</div>'; |
|
62 | + $output .= '<div class="kint-highlight">' . $this->renderer->escape($line) . "\n" . '</div>'; |
|
63 | 63 | } else { |
64 | - $output .= '<div>'.$this->renderer->escape($line)."\n".'</div>'; |
|
64 | + $output .= '<div>' . $this->renderer->escape($line) . "\n" . '</div>'; |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | |
71 | 71 | $data = ''; |
72 | 72 | if ($r->showfilename) { |
73 | - $data = ' data-kint-filename="'.$this->renderer->escape($r->filename).'"'; |
|
73 | + $data = ' data-kint-filename="' . $this->renderer->escape($r->filename) . '"'; |
|
74 | 74 | } |
75 | 75 | |
76 | - return '<div><pre class="kint-source"'.$data.' style="counter-reset: kint-l '.((int) \key($source) - 1).';">'.$output.'</pre></div><div></div>'; |
|
76 | + return '<div><pre class="kint-source"' . $data . ' style="counter-reset: kint-l ' . ((int) \key($source) - 1) . ';">' . $output . '</pre></div><div></div>'; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $children = $this->renderChildren($o); |
228 | 228 | $header = $this->renderHeaderWrapper($o, (bool) \strlen($children), $this->renderHeader($o)); |
229 | 229 | |
230 | - return '<dl>'.$header.$children.'</dl>'; |
|
230 | + return '<dl>' . $header . $children . '</dl>'; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | public function renderNothing() |
@@ -269,10 +269,10 @@ discard block |
||
269 | 269 | $out .= $contents; |
270 | 270 | |
271 | 271 | if (!empty($ap)) { |
272 | - $out .= '<div class="access-path">'.$this->escape($ap).'</div>'; |
|
272 | + $out .= '<div class="access-path">' . $this->escape($ap) . '</div>'; |
|
273 | 273 | } |
274 | 274 | |
275 | - return $out.'</dt>'; |
|
275 | + return $out . '</dt>'; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | public function renderHeader(Value $o) |
@@ -280,14 +280,14 @@ discard block |
||
280 | 280 | $output = ''; |
281 | 281 | |
282 | 282 | if (null !== ($s = $o->getModifiers())) { |
283 | - $output .= '<var>'.$s.'</var> '; |
|
283 | + $output .= '<var>' . $s . '</var> '; |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | if (null !== ($s = $o->getName())) { |
287 | - $output .= '<dfn>'.$this->escape($s).'</dfn> '; |
|
287 | + $output .= '<dfn>' . $this->escape($s) . '</dfn> '; |
|
288 | 288 | |
289 | 289 | if ($s = $o->getOperator()) { |
290 | - $output .= $this->escape($s, 'ASCII').' '; |
|
290 | + $output .= $this->escape($s, 'ASCII') . ' '; |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | |
@@ -297,17 +297,17 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | if ($o->reference) { |
300 | - $s = '&'.$s; |
|
300 | + $s = '&' . $s; |
|
301 | 301 | } |
302 | 302 | |
303 | - $output .= '<var>'.$s.'</var> '; |
|
303 | + $output .= '<var>' . $s . '</var> '; |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | if (null !== ($s = $o->getSize())) { |
307 | 307 | if (self::$escape_types) { |
308 | 308 | $s = $this->escape($s); |
309 | 309 | } |
310 | - $output .= '('.$s.') '; |
|
310 | + $output .= '(' . $s . ') '; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | if (null !== ($s = $o->getValueShort())) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $output .= '<li>'; |
355 | 355 | } |
356 | 356 | |
357 | - $output .= $this->escape($tab->getLabel()).'</li>'; |
|
357 | + $output .= $this->escape($tab->getLabel()) . '</li>'; |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | $output .= '</ul><ul class="kint-tab-contents">'; |
@@ -366,13 +366,13 @@ discard block |
||
366 | 366 | $output .= '<li>'; |
367 | 367 | } |
368 | 368 | |
369 | - $output .= $tab.'</li>'; |
|
369 | + $output .= $tab . '</li>'; |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | $output .= '</ul>'; |
373 | 373 | } |
374 | 374 | |
375 | - return $output.'</dd>'; |
|
375 | + return $output . '</dd>'; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | public function preRender() |
@@ -394,16 +394,16 @@ discard block |
||
394 | 394 | case 'script': |
395 | 395 | $output .= '<script class="kint-rich-script"'; |
396 | 396 | if (null !== self::$js_nonce) { |
397 | - $output .= ' nonce="'.\htmlspecialchars(self::$js_nonce).'"'; |
|
397 | + $output .= ' nonce="' . \htmlspecialchars(self::$js_nonce) . '"'; |
|
398 | 398 | } |
399 | - $output .= '>'.$contents.'</script>'; |
|
399 | + $output .= '>' . $contents . '</script>'; |
|
400 | 400 | break; |
401 | 401 | case 'style': |
402 | 402 | $output .= '<style class="kint-rich-style"'; |
403 | 403 | if (null !== self::$css_nonce) { |
404 | - $output .= ' nonce="'.\htmlspecialchars(self::$css_nonce).'"'; |
|
404 | + $output .= ' nonce="' . \htmlspecialchars(self::$css_nonce) . '"'; |
|
405 | 405 | } |
406 | - $output .= '>'.$contents.'</style>'; |
|
406 | + $output .= '>' . $contents . '</style>'; |
|
407 | 407 | break; |
408 | 408 | default: |
409 | 409 | $output .= $contents; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $output .= ' kint-file'; |
423 | 423 | |
424 | 424 | if (self::$needs_folder_render || $this->force_pre_render) { |
425 | - $output = $this->renderFolder().$output; |
|
425 | + $output = $this->renderFolder() . $output; |
|
426 | 426 | |
427 | 427 | if (!$this->force_pre_render) { |
428 | 428 | self::$needs_folder_render = false; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | } |
450 | 450 | |
451 | 451 | if (isset($this->call_info['callee']['file'])) { |
452 | - $output .= 'Called from '.$this->ideLink( |
|
452 | + $output .= 'Called from ' . $this->ideLink( |
|
453 | 453 | $this->call_info['callee']['file'], |
454 | 454 | $this->call_info['callee']['line'] |
455 | 455 | ); |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | if (isset($this->call_info['callee']['type'])) { |
472 | 472 | $output .= $this->call_info['callee']['type']; |
473 | 473 | } |
474 | - $output .= $this->call_info['callee']['function'].'()]'; |
|
474 | + $output .= $this->call_info['callee']['function'] . '()]'; |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | if (!empty($this->call_info['trace']) && \count($this->call_info['trace']) > 1) { |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | continue; |
482 | 482 | } |
483 | 483 | |
484 | - $output .= '<li>'.$this->ideLink($step['file'], $step['line']); // closing tag not required |
|
484 | + $output .= '<li>' . $this->ideLink($step['file'], $step['line']); // closing tag not required |
|
485 | 485 | if (isset($step['function']) |
486 | 486 | && !\in_array($step['function'], ['include', 'include_once', 'require', 'require_once'], true) |
487 | 487 | ) { |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if (isset($step['type'])) { |
493 | 493 | $output .= $step['type']; |
494 | 494 | } |
495 | - $output .= $step['function'].'()]'; |
|
495 | + $output .= $step['function'] . '()]'; |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | $output .= '</ol>'; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | |
528 | 528 | public function ideLink($file, $line) |
529 | 529 | { |
530 | - $path = $this->escape(Kint::shortenPath($file)).':'.$line; |
|
530 | + $path = $this->escape(Kint::shortenPath($file)) . ':' . $line; |
|
531 | 531 | $ideLink = Kint::getIdeLink($file, $line); |
532 | 532 | |
533 | 533 | if (!$ideLink) { |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $class = 'class="kint-ide-link" '; |
541 | 541 | } |
542 | 542 | |
543 | - return '<a '.$class.'href="'.$this->escape($ideLink).'">'.$path.'</a>'; |
|
543 | + return '<a ' . $class . 'href="' . $this->escape($ideLink) . '">' . $path . '</a>'; |
|
544 | 544 | } |
545 | 545 | |
546 | 546 | protected function renderTab(Value $o, Representation $rep) |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | } |
589 | 589 | |
590 | 590 | if ($show_contents) { |
591 | - return '<pre>'.$this->escape($rep->contents)."\n</pre>"; |
|
591 | + return '<pre>' . $this->escape($rep->contents) . "\n</pre>"; |
|
592 | 592 | } |
593 | 593 | } |
594 | 594 | |
@@ -614,13 +614,13 @@ discard block |
||
614 | 614 | |
615 | 615 | protected static function renderJs() |
616 | 616 | { |
617 | - return \file_get_contents(KINT_DIR.'/resources/compiled/shared.js').\file_get_contents(KINT_DIR.'/resources/compiled/rich.js'); |
|
617 | + return \file_get_contents(KINT_DIR . '/resources/compiled/shared.js') . \file_get_contents(KINT_DIR . '/resources/compiled/rich.js'); |
|
618 | 618 | } |
619 | 619 | |
620 | 620 | protected static function renderCss() |
621 | 621 | { |
622 | - if (\file_exists(KINT_DIR.'/resources/compiled/'.self::$theme)) { |
|
623 | - return \file_get_contents(KINT_DIR.'/resources/compiled/'.self::$theme); |
|
622 | + if (\file_exists(KINT_DIR . '/resources/compiled/' . self::$theme)) { |
|
623 | + return \file_get_contents(KINT_DIR . '/resources/compiled/' . self::$theme); |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | return \file_get_contents(self::$theme); |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | $out = ''; |
118 | 118 | |
119 | 119 | if (0 == $o->depth) { |
120 | - $out .= $this->colorTitle($this->renderTitle($o)).PHP_EOL; |
|
120 | + $out .= $this->colorTitle($this->renderTitle($o)) . PHP_EOL; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | $out .= $this->renderHeader($o); |
124 | - $out .= $this->renderChildren($o).PHP_EOL; |
|
124 | + $out .= $this->renderChildren($o) . PHP_EOL; |
|
125 | 125 | |
126 | 126 | return $out; |
127 | 127 | } |
@@ -131,24 +131,24 @@ discard block |
||
131 | 131 | if (self::$decorations) { |
132 | 132 | return $this->colorTitle( |
133 | 133 | $this->boxText('No argument', $this->header_width) |
134 | - ).PHP_EOL; |
|
134 | + ) . PHP_EOL; |
|
135 | 135 | } |
136 | 136 | |
137 | - return $this->colorTitle('No argument').PHP_EOL; |
|
137 | + return $this->colorTitle('No argument') . PHP_EOL; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | public function boxText($text, $width) |
141 | 141 | { |
142 | - $out = '┌'.\str_repeat('─', $width - 2).'┐'.PHP_EOL; |
|
142 | + $out = '┌' . \str_repeat('─', $width - 2) . '┐' . PHP_EOL; |
|
143 | 143 | |
144 | 144 | if (\strlen($text)) { |
145 | 145 | $text = Utils::truncateString($text, $width - 4); |
146 | 146 | $text = \str_pad($text, $width - 4); |
147 | 147 | |
148 | - $out .= '│ '.$this->escape($text).' │'.PHP_EOL; |
|
148 | + $out .= '│ ' . $this->escape($text) . ' │' . PHP_EOL; |
|
149 | 149 | } |
150 | 150 | |
151 | - $out .= '└'.\str_repeat('─', $width - 2).'┘'; |
|
151 | + $out .= '└' . \str_repeat('─', $width - 2) . '┘'; |
|
152 | 152 | |
153 | 153 | return $out; |
154 | 154 | } |
@@ -184,14 +184,14 @@ discard block |
||
184 | 184 | |
185 | 185 | if (null !== ($s = $o->getType())) { |
186 | 186 | if ($o->reference) { |
187 | - $s = '&'.$s; |
|
187 | + $s = '&' . $s; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | $output[] = $this->colorType($this->escape($s)); |
191 | 191 | } |
192 | 192 | |
193 | 193 | if (null !== ($s = $o->getSize())) { |
194 | - $output[] = '('.$this->escape($s).')'; |
|
194 | + $output[] = '(' . $this->escape($s) . ')'; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | if (null !== ($s = $o->getValueShort())) { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $output[] = $this->colorValue($this->escape($s)); |
202 | 202 | } |
203 | 203 | |
204 | - return \str_repeat(' ', $o->depth * $this->indent_width).\implode(' ', $output); |
|
204 | + return \str_repeat(' ', $o->depth * $this->indent_width) . \implode(' ', $output); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | public function renderChildren(Value $o) |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | if ($children) { |
232 | - $output .= PHP_EOL.$children; |
|
232 | + $output .= PHP_EOL . $children; |
|
233 | 233 | $output .= \str_repeat(' ', $o->depth * $this->indent_width); |
234 | 234 | } |
235 | 235 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $output .= PHP_EOL; |
274 | 274 | } |
275 | 275 | |
276 | - return $this->colorTitle($output.$this->calledFrom().PHP_EOL); |
|
276 | + return $this->colorTitle($output . $this->calledFrom() . PHP_EOL); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | public function filterParserPlugins(array $plugins) |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | public function ideLink($file, $line) |
296 | 296 | { |
297 | - return $this->escape(Kint::shortenPath($file)).':'.$line; |
|
297 | + return $this->escape(Kint::shortenPath($file)) . ':' . $line; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | public function escape($string, $encoding = false) |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $output = ''; |
308 | 308 | |
309 | 309 | if (isset($this->call_info['callee']['file'])) { |
310 | - $output .= 'Called from '.$this->ideLink( |
|
310 | + $output .= 'Called from ' . $this->ideLink( |
|
311 | 311 | $this->call_info['callee']['file'], |
312 | 312 | $this->call_info['callee']['line'] |
313 | 313 | ); |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | if (isset($this->call_info['callee']['type'])) { |
330 | 330 | $output .= $this->call_info['callee']['type']; |
331 | 331 | } |
332 | - $output .= $this->call_info['callee']['function'].'()]'; |
|
332 | + $output .= $this->call_info['callee']['function'] . '()]'; |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | return $output; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return $string; |
124 | 124 | } |
125 | 125 | |
126 | - return "\x1b[32m".\str_replace("\n", "\x1b[0m\n\x1b[32m", $string)."\x1b[0m"; |
|
126 | + return "\x1b[32m" . \str_replace("\n", "\x1b[0m\n\x1b[32m", $string) . "\x1b[0m"; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | public function colorType($string) |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return $string; |
133 | 133 | } |
134 | 134 | |
135 | - return "\x1b[35;1m".\str_replace("\n", "\x1b[0m\n\x1b[35;1m", $string)."\x1b[0m"; |
|
135 | + return "\x1b[35;1m" . \str_replace("\n", "\x1b[0m\n\x1b[35;1m", $string) . "\x1b[0m"; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | public function colorTitle($string) |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | return $string; |
142 | 142 | } |
143 | 143 | |
144 | - return "\x1b[36m".\str_replace("\n", "\x1b[0m\n\x1b[36m", $string)."\x1b[0m"; |
|
144 | + return "\x1b[36m" . \str_replace("\n", "\x1b[0m\n\x1b[36m", $string) . "\x1b[0m"; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | public function renderTitle(Value $o) |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return Parser::TRIGGER_SUCCESS; |
41 | 41 | } |
42 | 42 | |
43 | - public function parse(&$var, Value &$o, $trigger) |
|
43 | + public function parse(&$var, Value & $o, $trigger) |
|
44 | 44 | { |
45 | 45 | if (!isset($var[0]) || ('{' !== $var[0] && '[' !== $var[0])) { |
46 | 46 | return; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $base_obj->depth = $o->depth; |
59 | 59 | |
60 | 60 | if ($o->access_path) { |
61 | - $base_obj->access_path = 'json_decode('.$o->access_path.', true)'; |
|
61 | + $base_obj->access_path = 'json_decode(' . $o->access_path . ', true)'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $r = new Representation('Json'); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | return Parser::TRIGGER_BEGIN; |
41 | 41 | } |
42 | 42 | |
43 | - public function parse(&$var, Value &$o, $trigger) |
|
43 | + public function parse(&$var, Value & $o, $trigger) |
|
44 | 44 | { |
45 | 45 | if (!$var instanceof ArrayObject) { |
46 | 46 | return; |