function DumpDataCollector::dump
Overrides DataDumperInterface::dump
File
-
vendor/
symfony/ http-kernel/ DataCollector/ DumpDataCollector.php, line 73
Class
- DumpDataCollector
- @author Nicolas Grekas <p@tchwork.com>
Namespace
Symfony\Component\HttpKernel\DataCollectorCode
public function dump(Data $data) : ?string {
$this->stopwatch?->start('dump');
[
'name' => $name,
'file' => $file,
'line' => $line,
'file_excerpt' => $fileExcerpt,
] = $this->sourceContextProvider
->getContext();
if (!$this->dumper || $this->dumper instanceof Connection && !$this->dumper
->write($data)) {
$this->isCollected = false;
}
$context = $data->getContext();
$label = $context['label'] ?? '';
unset($context['label']);
$data = $data->withContext($context);
if ($this->dumper && !$this->dumper instanceof Connection) {
$this->doDump($this->dumper, $data, $name, $file, $line, $label);
}
if (!$this->dataCount) {
$this->data = [];
}
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt', 'label');
++$this->dataCount;
$this->stopwatch?->stop('dump');
return null;
}