Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e8b2a3

Browse files
minor #20236 [HttpKernel] Fix source links with latests Twig versions (nicolas-grekas)
This PR was merged into the 2.7 branch. Discussion ---------- [HttpKernel] Fix source links with latests Twig versions | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20224 | License | MIT | Doc PR | - Commits ------- 3c21617 [HttpKernel] Fix source links with latests Twig versions
2 parents ef48f59 + 3c21617 commit 0e8b2a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ public function dump(Data $data)
9999
} elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof \Twig_Template) {
100100
$template = $trace[$i]['object'];
101101
$name = $template->getTemplateName();
102-
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : false;
103102
$src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false);
104103
$info = $template->getDebugInfo();
105-
if (null !== $src && isset($info[$trace[$i - 1]['line']])) {
104+
if (isset($info[$trace[$i - 1]['line']])) {
106105
$line = $info[$trace[$i - 1]['line']];
106+
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : false;
107107

108108
if ($src) {
109109
$src = explode("\n", $src);

0 commit comments

Comments
 (0)