Barryvdh\Debugbar\DataCollector\QueryCollector::getTwigInfo PHP Method

getTwigInfo() protected method

Get the filename/line from a Twig template trace
protected getTwigInfo ( array $trace ) : array
$trace array
return array The file and line
    protected function getTwigInfo($trace)
    {
        $file = $trace['object']->getTemplateName();
        if (isset($trace['line'])) {
            foreach ($trace['object']->getDebugInfo() as $codeLine => $templateLine) {
                if ($codeLine <= $trace['line']) {
                    return [$file, $templateLine];
                }
            }
        }
        return [$file, -1];
    }