Mercurial > hg > cmmr2012-drupal-site
diff vendor/symfony/var-dumper/Cloner/Data.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 | 12f9dff5fda9 |
line wrap: on
line diff
--- a/vendor/symfony/var-dumper/Cloner/Data.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/symfony/var-dumper/Cloner/Data.php Thu Feb 28 13:11:55 2019 +0000 @@ -44,7 +44,7 @@ $item = $item->value; } if (!$item instanceof Stub) { - return gettype($item); + return \gettype($item); } if (Stub::TYPE_STRING === $item->type) { return 'string'; @@ -63,7 +63,7 @@ /** * @param bool $recursive Whether values should be resolved recursively or not * - * @return string|int|float|bool|array|null|Data[] A native representation of the original value + * @return string|int|float|bool|array|Data[]|null A native representation of the original value */ public function getValue($recursive = false) { @@ -79,7 +79,7 @@ return $item->value; } - $children = $item->position ? $this->data[$item->position] : array(); + $children = $item->position ? $this->data[$item->position] : []; foreach ($children as $k => $v) { if ($recursive && !($v = $this->getStub($v)) instanceof Stub) { @@ -106,13 +106,13 @@ public function count() { - return count($this->getValue()); + return \count($this->getValue()); } public function getIterator() { - if (!is_array($value = $this->getValue())) { - throw new \LogicException(sprintf('%s object holds non-iterable type "%s".', self::class, gettype($value))); + if (!\is_array($value = $this->getValue())) { + throw new \LogicException(sprintf('%s object holds non-iterable type "%s".', self::class, \gettype($value))); } foreach ($value as $k => $v) { @@ -125,7 +125,7 @@ if (null !== $data = $this->seek($key)) { $item = $this->getStub($data->data[$data->position][$data->key]); - return $item instanceof Stub || array() === $item ? $data : $item; + return $item instanceof Stub || [] === $item ? $data : $item; } } @@ -158,11 +158,11 @@ { $value = $this->getValue(); - if (!is_array($value)) { + if (!\is_array($value)) { return (string) $value; } - return sprintf('%s (count=%d)', $this->getType(), count($value)); + return sprintf('%s (count=%d)', $this->getType(), \count($value)); } /** @@ -172,7 +172,7 @@ */ public function getRawData() { - @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); + @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__)); return $this->data; } @@ -239,7 +239,7 @@ if (!($item = $this->getStub($item)) instanceof Stub || !$item->position) { return; } - $keys = array($key); + $keys = [$key]; switch ($item->type) { case Stub::TYPE_OBJECT: @@ -275,7 +275,7 @@ */ public function dump(DumperInterface $dumper) { - $refs = array(0); + $refs = [0]; $this->dumpItem($dumper, new Cursor(), $refs, $this->data[$this->position][$this->key]); } @@ -295,7 +295,7 @@ $firstSeen = true; if (!$item instanceof Stub) { - $cursor->attr = array(); + $cursor->attr = []; $type = \gettype($item); if ($item && 'array' === $type) { $item = $this->getStub($item); @@ -312,7 +312,7 @@ $cursor->hardRefCount = $item->refCount; } $cursor->attr = $item->attr; - $type = $item->class ?: gettype($item->value); + $type = $item->class ?: \gettype($item->value); $item = $this->getStub($item->value); } if ($item instanceof Stub) { @@ -334,12 +334,12 @@ if ($cursor->stop) { if ($cut >= 0) { - $cut += count($children); + $cut += \count($children); } - $children = array(); + $children = []; } } else { - $children = array(); + $children = []; } switch ($item->type) { case Stub::TYPE_STRING: @@ -363,7 +363,7 @@ $cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class); } } elseif ($children && 0 <= $cut) { - $cut += count($children); + $cut += \count($children); } $cursor->skipChildren = false; $dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut); @@ -401,7 +401,7 @@ ++$cursor->depth; $cursor->hashType = $hashType; $cursor->hashIndex = 0; - $cursor->hashLength = count($children); + $cursor->hashLength = \count($children); $cursor->hashCut = $hashCut; foreach ($children as $key => $child) { $cursor->hashKeyIsBinary = isset($key[0]) && !preg_match('//u', $key);