summaryrefslogtreecommitdiff
path: root/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-02-03 13:44:03 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-02-04 11:17:33 +0000
commit7def76c7d817a9ec81e9ae4a03a850514b1a2e1c (patch)
tree3fcf7e8236356daac44f7c17b8c0c5bc736a0926 /vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php
parentadfb3656b8dac8505590490f4f8aaf4bea27881b (diff)
downloadwebtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.tar.gz
webtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.tar.bz2
webtrees-7def76c7d817a9ec81e9ae4a03a850514b1a2e1c.zip
Working on upgrade wizard and testing
Diffstat (limited to 'vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php')
-rw-r--r--vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php30
1 files changed, 18 insertions, 12 deletions
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('<a href="%s" title="%s">'.$s.'</a>', strip_tags($this->style('', $link)), $f, $name);
} else {
$name = sprintf('<abbr title="%s">'.$s.'</abbr>', $f, $name);