mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-09 00:46:31 +00:00
fixed some issues
This commit is contained in:
@@ -31,7 +31,7 @@ class LoaderError extends Error
|
||||
\Exception::__construct('', 0, $previous);
|
||||
|
||||
$this->appendMessage($message);
|
||||
$this->setTemplateLine(false);
|
||||
$this->setTemplateLine(-2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ abstract class CallExpression extends AbstractExpression
|
||||
return [null, []];
|
||||
}
|
||||
$r = new \ReflectionMethod($callable[0], $callable[1]);
|
||||
} elseif (\is_object($callable) && !$callable instanceof Closure) {
|
||||
} elseif (\is_object($callable) && !$callable instanceof \Closure) {
|
||||
$r = new \ReflectionObject($callable);
|
||||
$r = $r->getMethod('__invoke');
|
||||
$callable = [$callable, '__invoke'];
|
||||
|
||||
+3
-3
@@ -226,7 +226,7 @@ abstract class Template implements \Twig_TemplateInterface
|
||||
|
||||
// this is mostly useful for \Twig\Error\LoaderError exceptions
|
||||
// see \Twig\Error\LoaderError
|
||||
if (false === $e->getTemplateLine()) {
|
||||
if (-2 === $e->getTemplateLine()) {
|
||||
$e->setTemplateLine(-1);
|
||||
$e->guess();
|
||||
}
|
||||
@@ -371,7 +371,7 @@ abstract class Template implements \Twig_TemplateInterface
|
||||
$e->setSourceContext($templateName ? new Source('', $templateName) : $this->getSourceContext());
|
||||
}
|
||||
|
||||
if ($e->getTemplateLine()) {
|
||||
if ($e->getTemplateLine() > 0) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ abstract class Template implements \Twig_TemplateInterface
|
||||
|
||||
// this is mostly useful for \Twig\Error\LoaderError exceptions
|
||||
// see \Twig\Error\LoaderError
|
||||
if (false === $e->getTemplateLine()) {
|
||||
if (-2 === $e->getTemplateLine()) {
|
||||
$e->setTemplateLine(-1);
|
||||
$e->guess();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Twig\Util;
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class TemplateDirIterator extends IteratorIterator
|
||||
class TemplateDirIterator extends \IteratorIterator
|
||||
{
|
||||
public function current()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user