From 7def76c7d817a9ec81e9ae4a03a850514b1a2e1c Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Sun, 3 Feb 2019 13:44:03 +0000 Subject: Working on upgrade wizard and testing --- .../DataCollector/DumpDataCollector.php | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php') diff --git a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php index 13694f5a59..04ea44a073 100644 --- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php +++ b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php @@ -52,12 +52,12 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface $this->dumper = $dumper; // All clones share these properties by reference: - $this->rootRefs = array( + $this->rootRefs = [ &$this->data, &$this->dataCount, &$this->isCollected, &$this->clonesCount, - ); + ]; $this->sourceContextProvider = $dumper instanceof Connection && isset($dumper->getContextProviders()['source']) ? $dumper->getContextProviders()['source'] : new SourceContextProvider($this->charset); } @@ -110,7 +110,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface ) { if ($response->headers->has('Content-Type') && false !== strpos($response->headers->get('Content-Type'), 'html')) { $dumper = new HtmlDumper('php://output', $this->charset); - $dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat)); + $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); } else { $dumper = new CliDumper('php://output', $this->charset); } @@ -126,13 +126,16 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface if ($this->stopwatch) { $this->stopwatch->reset(); } - $this->data = array(); + $this->data = []; $this->dataCount = 0; $this->isCollected = true; $this->clonesCount = 0; $this->clonesIndex = 0; } + /** + * @internal + */ public function serialize() { if ($this->clonesCount !== $this->clonesIndex) { @@ -142,16 +145,19 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface $this->data[] = $this->fileLinkFormat; $this->data[] = $this->charset; $ser = serialize($this->data); - $this->data = array(); + $this->data = []; $this->dataCount = 0; $this->isCollected = true; return $ser; } + /** + * @internal + */ public function unserialize($data) { - parent::unserialize($data); + $this->data = unserialize($data); $charset = array_pop($this->data); $fileLinkFormat = array_pop($this->data); $this->dataCount = \count($this->data); @@ -169,11 +175,11 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface if ('html' === $format) { $dumper = new HtmlDumper($data, $this->charset); - $dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat)); + $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); } else { throw new \InvalidArgumentException(sprintf('Invalid dump format: %s', $format)); } - $dumps = array(); + $dumps = []; foreach ($this->data as $dump) { $dumper->dump($dump['data']->withMaxDepth($maxDepthLimit)->withMaxItemsPerDepth($maxItemsPerDepth)); @@ -207,12 +213,12 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface if (isset($_SERVER['VAR_DUMPER_FORMAT'])) { $html = 'html' === $_SERVER['VAR_DUMPER_FORMAT']; } else { - $html = !\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html'); + $html = !\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && stripos($h[$i], 'html'); } if ($html) { $dumper = new HtmlDumper('php://output', $this->charset); - $dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat)); + $dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]); } else { $dumper = new CliDumper('php://output', $this->charset); } @@ -222,7 +228,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface $this->doDump($dumper, $dump['data'], $dump['name'], $dump['file'], $dump['line']); } - $this->data = array(); + $this->data = []; $this->dataCount = 0; } } @@ -236,7 +242,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface $s = $this->style('meta', '%s'); $f = strip_tags($this->style('', $file)); $name = strip_tags($this->style('', $name)); - if ($fmt && $link = \is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line)) { + if ($fmt && $link = \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line)) { $name = sprintf(''.$s.'', strip_tags($this->style('', $link)), $f, $name); } else { $name = sprintf(''.$s.'', $f, $name); -- cgit v1.3