fixed some issues

This commit is contained in:
Fabien Potencier
2019-03-06 22:07:14 +01:00
parent 690f53f98c
commit c58fa84054
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ class LoaderError extends Error
\Exception::__construct('', 0, $previous);
$this->appendMessage($message);
$this->setTemplateLine(false);
$this->setTemplateLine(-2);
}
}
+1 -1
View File
@@ -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
View File
@@ -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();
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Twig\Util;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class TemplateDirIterator extends IteratorIterator
class TemplateDirIterator extends \IteratorIterator
{
public function current()
{