Skip to content

Commit 278a393

Browse files
[VarDumper] Fix dumping Twig source in stack traces
1 parent 90fd10a commit 278a393

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DataCollector/DumpDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function dump(Data $data)
103103
$info = $template->getDebugInfo();
104104
if (isset($info[$trace[$i - 1]['line']])) {
105105
$line = $info[$trace[$i - 1]['line']];
106-
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : false;
106+
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null;
107107

108108
if ($src) {
109109
$src = explode("\n", $src);
@@ -266,7 +266,7 @@ private function doDump($data, $name, $file, $line)
266266
if (PHP_VERSION_ID >= 50400 && $this->dumper instanceof CliDumper) {
267267
$contextDumper = function ($name, $file, $line, $fileLinkFormat) {
268268
if ($this instanceof HtmlDumper) {
269-
if ('' !== $file) {
269+
if ($file) {
270270
$s = $this->style('meta', '%s');
271271
$name = strip_tags($this->style('', $name));
272272
$file = strip_tags($this->style('', $file));

0 commit comments

Comments
 (0)