Mercurial > hg > cmmr2012-drupal-site
diff vendor/symfony/var-dumper/Caster/ClassStub.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/symfony/var-dumper/Caster/ClassStub.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/symfony/var-dumper/Caster/ClassStub.php Thu Feb 28 13:11:55 2019 +0000 @@ -19,15 +19,15 @@ class ClassStub extends ConstStub { /** - * @param string A PHP identifier, e.g. a class, method, interface, etc. name - * @param callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier + * @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name + * @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier */ public function __construct($identifier, $callable = null) { $this->value = $identifier; if (0 < $i = strrpos($identifier, '\\')) { - $this->attr['ellipsis'] = strlen($identifier) - $i; + $this->attr['ellipsis'] = \strlen($identifier) - $i; $this->attr['ellipsis-type'] = 'class'; $this->attr['ellipsis-tail'] = 1; } @@ -36,22 +36,22 @@ if (null !== $callable) { if ($callable instanceof \Closure) { $r = new \ReflectionFunction($callable); - } elseif (is_object($callable)) { - $r = array($callable, '__invoke'); - } elseif (is_array($callable)) { + } elseif (\is_object($callable)) { + $r = [$callable, '__invoke']; + } elseif (\is_array($callable)) { $r = $callable; } elseif (false !== $i = strpos($callable, '::')) { - $r = array(substr($callable, 0, $i), substr($callable, 2 + $i)); + $r = [substr($callable, 0, $i), substr($callable, 2 + $i)]; } else { $r = new \ReflectionFunction($callable); } } elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) { - $r = array(substr($identifier, 0, $i), substr($identifier, 2 + $i)); + $r = [substr($identifier, 0, $i), substr($identifier, 2 + $i)]; } else { $r = new \ReflectionClass($identifier); } - if (is_array($r)) { + if (\is_array($r)) { try { $r = new \ReflectionMethod($r[0], $r[1]); } catch (\ReflectionException $e) { @@ -70,13 +70,13 @@ public static function wrapCallable($callable) { - if (is_object($callable) || !is_callable($callable)) { + if (\is_object($callable) || !\is_callable($callable)) { return $callable; } - if (!is_array($callable)) { + if (!\is_array($callable)) { $callable = new static($callable); - } elseif (is_string($callable[0])) { + } elseif (\is_string($callable[0])) { $callable[0] = new static($callable[0]); } else { $callable[1] = new static($callable[1], $callable);