mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 03:16:34 +00:00
remove not needed code
This commit is contained in:
+1
-5
@@ -139,15 +139,11 @@ class Error extends \Exception
|
|||||||
|
|
||||||
$this->lineno = 0;
|
$this->lineno = 0;
|
||||||
$template = null;
|
$template = null;
|
||||||
$templateClass = null;
|
|
||||||
$backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT);
|
$backtrace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT);
|
||||||
foreach ($backtrace as $trace) {
|
foreach ($backtrace as $trace) {
|
||||||
if (isset($trace['object']) && $trace['object'] instanceof Template) {
|
if (isset($trace['object']) && $trace['object'] instanceof Template) {
|
||||||
$currentClass = \get_class($trace['object']);
|
if ($this->source->getName() === $trace['object']->getTemplateName()) {
|
||||||
$isEmbedContainer = null === $templateClass ? false : str_starts_with($templateClass, $currentClass);
|
|
||||||
if ($this->source->getName() === $trace['object']->getTemplateName() && !$isEmbedContainer) {
|
|
||||||
$template = $trace['object'];
|
$template = $trace['object'];
|
||||||
$templateClass = \get_class($trace['object']);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user