fixed error message

This commit is contained in:
Fabien Potencier
2016-09-24 12:10:10 -07:00
parent af2e1111ae
commit 0980fe0871
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -950,7 +950,7 @@ class Twig_Environment
public function addFilter($name, $filter = null)
{
if (!$name instanceof Twig_SimpleFilter && !($filter instanceof Twig_SimpleFilter || $filter instanceof Twig_FilterInterface)) {
throw new LogicException('A filter must be an instance of Twig_FilterInterface or Twig_SimpleFilter');
throw new LogicException('A filter must be an instance of Twig_FilterInterface or Twig_SimpleFilter.');
}
if ($name instanceof Twig_SimpleFilter) {
+1 -1
View File
@@ -373,7 +373,7 @@ class Twig_Parser implements Twig_ParserInterface
(!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface)
) {
if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) {
throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed', $node->getLine(), $this->getFilename());
throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed.', $node->getLine(), $this->getFilename());
}
throw new Twig_Error_Syntax('A template that extends another one cannot include contents outside Twig blocks. Did you forget to put the contents inside a {% block %} tag?', $node->getLine(), $this->getFilename());
+2 -2
View File
@@ -431,7 +431,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
return;
}
throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName());
throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist.', $item), -1, $this->getTemplateName());
}
return $context[$item];
@@ -579,7 +579,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
return;
}
throw new Twig_Error_Runtime(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s"', $item, get_class($object)), -1, $this->getTemplateName());
throw new Twig_Error_Runtime(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, get_class($object)), -1, $this->getTemplateName());
}
if ($isDefinedTest) {