@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | foreach ($bt as $frame) { |
| 251 | 251 | if (isset($frame['object']) && $frame['object'] === $this) { |
| 252 | - throw new DomainException(__CLASS__.'::'.$caller_frame['function'].' cannot be called from inside a parse'); |
|
| 252 | + throw new DomainException(__CLASS__ . '::' . $caller_frame['function'] . ' cannot be called from inside a parse'); |
|
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | } |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | if (null !== $array->access_path) { |
| 366 | 366 | if (\is_string($key) && (string) (int) $key === $key) { |
| 367 | - $child->access_path = 'array_values('.$array->access_path.')['.$i.']'; // @codeCoverageIgnore |
|
| 367 | + $child->access_path = 'array_values(' . $array->access_path . ')[' . $i . ']'; // @codeCoverageIgnore |
|
| 368 | 368 | } else { |
| 369 | - $child->access_path = $array->access_path.'['.\var_export($key, true).']'; |
|
| 369 | + $child->access_path = $array->access_path . '[' . \var_export($key, true) . ']'; |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | |
| 467 | 467 | // Can't dynamically add undefined properties, so no need to use var_export |
| 468 | 468 | if ($this->childHasPath($object, $child)) { |
| 469 | - $child->access_path .= $object->access_path.'->'.$child->name; |
|
| 469 | + $child->access_path .= $object->access_path . '->' . $child->name; |
|
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | if ($this->applyPlugins($undefined, $child, self::TRIGGER_BEGIN)) { |
@@ -515,11 +515,11 @@ discard block |
||
| 515 | 515 | $child->access_path = $object->access_path; |
| 516 | 516 | |
| 517 | 517 | if (!KINT_PHP72 && \is_int($child->name)) { |
| 518 | - $child->access_path = 'array_values((array) '.$child->access_path.')['.$i.']'; // @codeCoverageIgnore |
|
| 518 | + $child->access_path = 'array_values((array) ' . $child->access_path . ')[' . $i . ']'; // @codeCoverageIgnore |
|
| 519 | 519 | } elseif (\preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $child->name)) { |
| 520 | - $child->access_path .= '->'.$child->name; |
|
| 520 | + $child->access_path .= '->' . $child->name; |
|
| 521 | 521 | } else { |
| 522 | - $child->access_path .= '->{'.\var_export((string) $child->name, true).'}'; |
|
| 522 | + $child->access_path .= '->{' . \var_export((string) $child->name, true) . '}'; |
|
| 523 | 523 | } |
| 524 | 524 | } |
| 525 | 525 | |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | * |
| 587 | 587 | * @return bool Continue parsing |
| 588 | 588 | */ |
| 589 | - private function applyPlugins(&$var, Value &$o, $trigger) |
|
| 589 | + private function applyPlugins(&$var, Value & $o, $trigger) |
|
| 590 | 590 | { |
| 591 | 591 | $break_stash = $this->parse_break; |
| 592 | 592 | |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | $plugin->parse($var, $o, $trigger); |
| 605 | 605 | } catch (Exception $e) { |
| 606 | 606 | \trigger_error( |
| 607 | - 'An exception ('.\get_class($e).') was thrown in '.$e->getFile().' on line '.$e->getLine().' while executing Kint Parser Plugin "'.\get_class($plugin).'". Error message: '.$e->getMessage(), |
|
| 607 | + 'An exception (' . \get_class($e) . ') was thrown in ' . $e->getFile() . ' on line ' . $e->getLine() . ' while executing Kint Parser Plugin "' . \get_class($plugin) . '". Error message: ' . $e->getMessage(), |
|
| 608 | 608 | E_USER_WARNING |
| 609 | 609 | ); |
| 610 | 610 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return Parser::TRIGGER_SUCCESS; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function parse(&$var, Value &$o, $trigger) |
|
| 45 | + public function parse(&$var, Value & $o, $trigger) |
|
| 46 | 46 | { |
| 47 | 47 | if (!$o instanceof ResourceValue || 'stream' !== $o->resource_type) { |
| 48 | 48 | return; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $base_obj->depth = $o->depth; |
| 63 | 63 | |
| 64 | 64 | if ($o->access_path) { |
| 65 | - $base_obj->access_path = 'stream_get_meta_data('.$o->access_path.')'; |
|
| 65 | + $base_obj->access_path = 'stream_get_meta_data(' . $o->access_path . ')'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $rep->contents = $this->parser->parse($meta, $base_obj); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | return Parser::TRIGGER_BEGIN; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function parse(&$var, Value &$o, $trigger) |
|
| 57 | + public function parse(&$var, Value & $o, $trigger) |
|
| 58 | 58 | { |
| 59 | 59 | foreach (self::$blacklist as $class) { |
| 60 | 60 | if ($var instanceof $class) { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - protected function blacklistValue(&$var, Value &$o) |
|
| 76 | + protected function blacklistValue(&$var, Value & $o) |
|
| 77 | 77 | { |
| 78 | 78 | $object = new InstanceValue(); |
| 79 | 79 | $object->transplant($o); |
@@ -40,7 +40,7 @@ |
||
| 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 (!$o instanceof BlobValue || !\in_array($o->encoding, ['ASCII', 'UTF-8'], true)) { |
| 46 | 46 | $o->value->hints[] = 'binary'; |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | return Parser::TRIGGER_SUCCESS; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function parse(&$var, Value &$o, $trigger) |
|
| 49 | + public function parse(&$var, Value & $o, $trigger) |
|
| 50 | 50 | { |
| 51 | 51 | if (\is_string($var) && !\ctype_digit($var)) { |
| 52 | 52 | return; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | return Parser::TRIGGER_COMPLETE; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function parse(&$var, Value &$o, $trigger) |
|
| 45 | + public function parse(&$var, Value & $o, $trigger) |
|
| 46 | 46 | { |
| 47 | 47 | if (!$var instanceof SplFileInfo || $var instanceof SplFileObject) { |
| 48 | 48 | return; |
@@ -53,17 +53,17 @@ discard block |
||
| 53 | 53 | return Parser::TRIGGER_SUCCESS; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function parse(&$var, Value &$o, $trigger) |
|
| 56 | + public function parse(&$var, Value & $o, $trigger) |
|
| 57 | 57 | { |
| 58 | 58 | if ('<?xml' !== \substr($var, 0, 5)) { |
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (!\method_exists(\get_class($this), 'xmlTo'.self::$parse_method)) { |
|
| 62 | + if (!\method_exists(\get_class($this), 'xmlTo' . self::$parse_method)) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $xml = \call_user_func([\get_class($this), 'xmlTo'.self::$parse_method], $var, $o->access_path); |
|
| 66 | + $xml = \call_user_func([\get_class($this), 'xmlTo' . self::$parse_method], $var, $o->access_path); |
|
| 67 | 67 | |
| 68 | 68 | if (empty($xml)) { |
| 69 | 69 | return; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if (null === $parent_path) { |
| 104 | 104 | $access_path = null; |
| 105 | 105 | } else { |
| 106 | - $access_path = 'simplexml_load_string('.$parent_path.')'; |
|
| 106 | + $access_path = 'simplexml_load_string(' . $parent_path . ')'; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $name = $xml->getName(); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | if (null === $parent_path) { |
| 148 | 148 | $access_path = null; |
| 149 | 149 | } else { |
| 150 | - $access_path = '(function($s){$x = new \\DomDocument(); $x->loadXML($s); return $x;})('.$parent_path.')->'.$access_path; |
|
| 150 | + $access_path = '(function($s){$x = new \\DomDocument(); $x->loadXML($s); return $x;})(' . $parent_path . ')->' . $access_path; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | $name = isset($xml->nodeName) ? $xml->nodeName : null; |
@@ -399,10 +399,10 @@ discard block |
||
| 399 | 399 | $access_path = $param['path']; |
| 400 | 400 | |
| 401 | 401 | if (!empty($param['expression'])) { |
| 402 | - $access_path = '('.$access_path.')'; |
|
| 402 | + $access_path = '(' . $access_path . ')'; |
|
| 403 | 403 | } |
| 404 | 404 | } else { |
| 405 | - $access_path = '$'.$i; |
|
| 405 | + $access_path = '$' . $i; |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | $bases[] = Value::blank($name, $access_path); |
@@ -641,11 +641,11 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | foreach ($file as $i => $part) { |
| 643 | 643 | if (!isset($kint[$i]) || $kint[$i] !== $part) { |
| 644 | - return ($i ? '.../' : '/').\implode('/', \array_slice($file, $i)); |
|
| 644 | + return ($i ? '.../' : '/') . \implode('/', \array_slice($file, $i)); |
|
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | - return '/'.\implode('/', $file); |
|
| 648 | + return '/' . \implode('/', $file); |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | public static function getIdeLink($file, $line) |
@@ -690,14 +690,14 @@ discard block |
||
| 690 | 690 | if ($i < $argc && $i === \count($call['parameters']) - 1) { |
| 691 | 691 | for ($j = 1; $j + $i < $argc; ++$j) { |
| 692 | 692 | $call['parameters'][] = [ |
| 693 | - 'name' => 'array_values('.\substr($param['name'], 3).')['.$j.']', |
|
| 694 | - 'path' => 'array_values('.\substr($param['path'], 3).')['.$j.']', |
|
| 693 | + 'name' => 'array_values(' . \substr($param['name'], 3) . ')[' . $j . ']', |
|
| 694 | + 'path' => 'array_values(' . \substr($param['path'], 3) . ')[' . $j . ']', |
|
| 695 | 695 | 'expression' => false, |
| 696 | 696 | ]; |
| 697 | 697 | } |
| 698 | 698 | |
| 699 | - $param['name'] = 'reset('.\substr($param['name'], 3).')'; |
|
| 700 | - $param['path'] = 'reset('.\substr($param['path'], 3).')'; |
|
| 699 | + $param['name'] = 'reset(' . \substr($param['name'], 3) . ')'; |
|
| 700 | + $param['path'] = 'reset(' . \substr($param['path'], 3) . ')'; |
|
| 701 | 701 | $param['expression'] = false; |
| 702 | 702 | } else { |
| 703 | 703 | $call['parameters'] = \array_slice($call['parameters'], 0, $i); |
@@ -101,10 +101,10 @@ discard block |
||
| 101 | 101 | return $extras; // @codeCoverageIgnore |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $folder = KINT_DIR.'/vendor'; |
|
| 104 | + $folder = KINT_DIR . '/vendor'; |
|
| 105 | 105 | |
| 106 | 106 | for ($i = 0; $i < 4; ++$i) { |
| 107 | - $installed = $folder.'/composer/installed.json'; |
|
| 107 | + $installed = $folder . '/composer/installed.json'; |
|
| 108 | 108 | |
| 109 | 109 | if (\file_exists($installed) && \is_readable($installed)) { |
| 110 | 110 | $packages = \json_decode(\file_get_contents($installed), true); |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $folder = \dirname($folder); |
| 119 | 119 | |
| 120 | - if (\file_exists($folder.'/composer.json') && \is_readable($folder.'/composer.json')) { |
|
| 121 | - $composer = \json_decode(\file_get_contents($folder.'/composer.json'), true); |
|
| 120 | + if (\file_exists($folder . '/composer.json') && \is_readable($folder . '/composer.json')) { |
|
| 121 | + $composer = \json_decode(\file_get_contents($folder . '/composer.json'), true); |
|
| 122 | 122 | |
| 123 | 123 | if (isset($composer['extra'][$key]) && \is_array($composer['extra'][$key])) { |
| 124 | 124 | $extras = \array_replace($extras, $composer['extra'][$key]); |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $alias = \array_values(\array_filter($alias, 'is_string')); |
| 212 | 212 | |
| 213 | 213 | if (2 === \count($alias) && |
| 214 | - \preg_match('/^'.$name_regex.'$/', $alias[1]) && |
|
| 215 | - \preg_match('/^\\\\?('.$name_regex.'\\\\)*'.$name_regex.'$/', $alias[0]) |
|
| 214 | + \preg_match('/^' . $name_regex . '$/', $alias[1]) && |
|
| 215 | + \preg_match('/^\\\\?(' . $name_regex . '\\\\)*' . $name_regex . '$/', $alias[0]) |
|
| 216 | 216 | ) { |
| 217 | 217 | $alias = [ |
| 218 | 218 | \strtolower(\ltrim($alias[0], '\\')), |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | continue; |
| 224 | 224 | } |
| 225 | 225 | } elseif (\is_string($alias)) { |
| 226 | - if (\preg_match('/^\\\\?('.$name_regex.'\\\\)*'.$name_regex.'$/', $alias)) { |
|
| 226 | + if (\preg_match('/^\\\\?(' . $name_regex . '\\\\)*' . $name_regex . '$/', $alias)) { |
|
| 227 | 227 | $alias = \explode('\\', \strtolower($alias)); |
| 228 | 228 | $alias = \end($alias); |
| 229 | 229 | } else { |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | if (BlobValue::strlen($input, $encoding) > $length) { |
| 252 | - return BlobValue::substr($input, 0, $length - $endlength, $encoding).$end; |
|
| 252 | + return BlobValue::substr($input, 0, $length - $endlength, $encoding) . $end; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | return $input; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | if ($type instanceof ReflectionNamedType) { |
| 261 | 261 | $name = $type->getName(); |
| 262 | 262 | if ($type->allowsNull() && false === \strpos($name, '|')) { |
| 263 | - $name = '?'.$name; |
|
| 263 | + $name = '?' . $name; |
|
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | return $name; |