diff --git a/lib/Twig/ExpressionParser.php b/lib/Twig/ExpressionParser.php index f35f89869..cad11af5e 100644 --- a/lib/Twig/ExpressionParser.php +++ b/lib/Twig/ExpressionParser.php @@ -171,7 +171,7 @@ class Twig_ExpressionParser $negClass = 'Twig_Node_Expression_Unary_Neg'; $posClass = 'Twig_Node_Expression_Unary_Pos'; if (!(in_array($ref->getName(), array($negClass, $posClass)) || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass))) { - throw new Twig_Error_Syntax(sprintf('Unexpected unary operator "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getFilename()); } $this->parser->getStream()->next(); @@ -187,7 +187,7 @@ class Twig_ExpressionParser } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) { $node = $this->parseHashExpression(); } else { - throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getFilename()); } } @@ -278,7 +278,7 @@ class Twig_ExpressionParser } else { $current = $stream->getCurrent(); - throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $this->parser->getFilename()); } $stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)'); @@ -317,11 +317,11 @@ class Twig_ExpressionParser case 'parent': $this->parseArguments(); if (!count($this->parser->getBlockStack())) { - throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden', $line, $this->parser->getFilename()); + throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden.', $line, $this->parser->getFilename()); } if (!$this->parser->getParent() && !$this->parser->hasTraits()) { - throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden', $line, $this->parser->getFilename()); + throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getFilename()); } return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line); @@ -330,7 +330,7 @@ class Twig_ExpressionParser case 'attribute': $args = $this->parseArguments(); if (count($args) < 2) { - throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename()); + throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getFilename()); } return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : null, Twig_Template::ANY_CALL, $line); @@ -384,13 +384,13 @@ class Twig_ExpressionParser if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { if (!$arg instanceof Twig_Node_Expression_Constant) { - throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s")', $node->getAttribute('name')), $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $this->parser->getFilename()); } $name = $arg->getAttribute('value'); if ($this->parser->isReservedMacroName($name)) { - throw new Twig_Error_Syntax(sprintf('"%s" cannot be called as macro as it is a reserved keyword', $name), $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('"%s" cannot be called as macro as it is a reserved keyword.', $name), $token->getLine(), $this->parser->getFilename()); } $node = new Twig_Node_Expression_MethodCall($node, 'get'.$name, $arguments, $lineno); @@ -500,7 +500,7 @@ class Twig_ExpressionParser $name = null; if ($namedArguments && $token = $stream->nextIf(Twig_Token::OPERATOR_TYPE, '=')) { if (!$value instanceof Twig_Node_Expression_Name) { - throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given', get_class($value)), $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('A parameter name must be a string, "%s" given.', get_class($value)), $token->getLine(), $this->parser->getFilename()); } $name = $value->getAttribute('name'); @@ -540,7 +540,7 @@ class Twig_ExpressionParser while (true) { $token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to'); if (in_array($token->getValue(), array('true', 'false', 'none'))) { - throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s".', $token->getValue()), $token->getLine(), $this->parser->getFilename()); } $targets[] = new Twig_Node_Expression_AssignName($token->getValue(), $token->getLine()); diff --git a/lib/Twig/Lexer.php b/lib/Twig/Lexer.php index 75f763fb9..575b4f3e4 100644 --- a/lib/Twig/Lexer.php +++ b/lib/Twig/Lexer.php @@ -129,7 +129,7 @@ class Twig_Lexer implements Twig_LexerInterface if (!empty($this->brackets)) { list($expect, $lineno) = array_pop($this->brackets); - throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->filename); } if ($mbEncoding) { @@ -224,7 +224,7 @@ class Twig_Lexer implements Twig_LexerInterface $this->moveCursor($match[0]); if ($this->cursor >= $this->end) { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->filename); } } @@ -256,12 +256,12 @@ class Twig_Lexer implements Twig_LexerInterface // closing bracket elseif (false !== strpos(')]}', $this->code[$this->cursor])) { if (empty($this->brackets)) { - throw new Twig_Error_Syntax(sprintf('Unexpected "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->filename); } list($expect, $lineno) = array_pop($this->brackets); if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->filename); } } @@ -281,7 +281,7 @@ class Twig_Lexer implements Twig_LexerInterface } // unlexable else { - throw new Twig_Error_Syntax(sprintf('Unexpected character "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->filename); } } @@ -292,7 +292,7 @@ class Twig_Lexer implements Twig_LexerInterface } if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block', $tag), $this->lineno, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->filename); } $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); @@ -308,7 +308,7 @@ class Twig_Lexer implements Twig_LexerInterface protected function lexComment() { if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { - throw new Twig_Error_Syntax('Unclosed comment', $this->lineno, $this->filename); + throw new Twig_Error_Syntax('Unclosed comment.', $this->lineno, $this->filename); } $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); @@ -327,7 +327,7 @@ class Twig_Lexer implements Twig_LexerInterface } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) { list($expect, $lineno) = array_pop($this->brackets); if ($this->code[$this->cursor] != '"') { - throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename); + throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->filename); } $this->popState(); diff --git a/lib/Twig/Node/Expression/Test/Defined.php b/lib/Twig/Node/Expression/Test/Defined.php index 247b2e23a..4b4a48a2b 100644 --- a/lib/Twig/Node/Expression/Test/Defined.php +++ b/lib/Twig/Node/Expression/Test/Defined.php @@ -34,7 +34,7 @@ class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test $this->changeIgnoreStrictCheck($node); } else { - throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine()); + throw new Twig_Error_Syntax('The "defined" test only works with simple variables.', $this->getLine()); } } diff --git a/lib/Twig/Node/Macro.php b/lib/Twig/Node/Macro.php index 715906d8d..932e795f0 100644 --- a/lib/Twig/Node/Macro.php +++ b/lib/Twig/Node/Macro.php @@ -22,7 +22,7 @@ class Twig_Node_Macro extends Twig_Node { foreach ($arguments as $argumentName => $argument) { if (self::VARARGS_NAME === $argumentName) { - throw new Twig_Error_Syntax(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getLine()); + throw new Twig_Error_Syntax(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments.', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getLine()); } } diff --git a/lib/Twig/Parser.php b/lib/Twig/Parser.php index 0f409dfd7..ed28a0e6a 100644 --- a/lib/Twig/Parser.php +++ b/lib/Twig/Parser.php @@ -250,7 +250,7 @@ class Twig_Parser implements Twig_ParserInterface public function setMacro($name, Twig_Node_Macro $node) { if ($this->isReservedMacroName($name)) { - throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword', $name), $node->getLine(), $this->getFilename()); + throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getLine(), $this->getFilename()); } $this->macros[$name] = $node; diff --git a/lib/Twig/Test/IntegrationTestCase.php b/lib/Twig/Test/IntegrationTestCase.php index 82d8654bb..45ca7dc49 100644 --- a/lib/Twig/Test/IntegrationTestCase.php +++ b/lib/Twig/Test/IntegrationTestCase.php @@ -165,7 +165,9 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase $template = $twig->loadTemplate('index.twig'); } catch (Exception $e) { if (false !== $exception) { - $this->assertSame(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage()))); + $message = $e->getMessage(); + $this->assertSame(trim($exception), trim(sprintf('%s: %s', get_class($e), $message))); + $this->assertSame('.', substr($message, strlen($message) - 1), $message, 'Exception message must end with a dot.'); return; } diff --git a/lib/Twig/TokenParser/AutoEscape.php b/lib/Twig/TokenParser/AutoEscape.php index 8f44e249e..c753e62a2 100644 --- a/lib/Twig/TokenParser/AutoEscape.php +++ b/lib/Twig/TokenParser/AutoEscape.php @@ -39,7 +39,7 @@ class Twig_TokenParser_AutoEscape extends Twig_TokenParser } else { $expr = $this->parser->getExpressionParser()->parseExpression(); if (!$expr instanceof Twig_Node_Expression_Constant) { - throw new Twig_Error_Syntax('An escaping strategy must be a string or a Boolean.', $stream->getCurrent()->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax('An escaping strategy must be a string or a bool.', $stream->getCurrent()->getLine(), $stream->getFilename()); } $value = $expr->getAttribute('value'); diff --git a/lib/Twig/TokenParser/Block.php b/lib/Twig/TokenParser/Block.php index 542cc7d55..4ffafbe71 100644 --- a/lib/Twig/TokenParser/Block.php +++ b/lib/Twig/TokenParser/Block.php @@ -28,7 +28,7 @@ class Twig_TokenParser_Block extends Twig_TokenParser $stream = $this->parser->getStream(); $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); if ($this->parser->hasBlock($name)) { - throw new Twig_Error_Syntax(sprintf("The block '%s' has already been defined line %d", $name, $this->parser->getBlock($name)->getLine()), $stream->getCurrent()->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getLine()), $stream->getCurrent()->getLine(), $stream->getFilename()); } $this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno)); $this->parser->pushLocalScope(); diff --git a/lib/Twig/TokenParser/Extends.php b/lib/Twig/TokenParser/Extends.php index 07a7605c9..510417ad1 100644 --- a/lib/Twig/TokenParser/Extends.php +++ b/lib/Twig/TokenParser/Extends.php @@ -22,11 +22,11 @@ class Twig_TokenParser_Extends extends Twig_TokenParser public function parse(Twig_Token $token) { if (!$this->parser->isMainScope()) { - throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax('Cannot extend from a block.', $token->getLine(), $this->parser->getFilename()); } if (null !== $this->parser->getParent()) { - throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax('Multiple extends tags are forbidden.', $token->getLine(), $this->parser->getFilename()); } $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); diff --git a/lib/Twig/TokenParser/For.php b/lib/Twig/TokenParser/For.php index 182b41e77..3fac51119 100644 --- a/lib/Twig/TokenParser/For.php +++ b/lib/Twig/TokenParser/For.php @@ -79,7 +79,7 @@ class Twig_TokenParser_For extends Twig_TokenParser protected function checkLoopUsageCondition(Twig_TokenStream $stream, Twig_NodeInterface $node) { if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { - throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition', $node->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax('The "loop" variable cannot be used in a looping condition.', $node->getLine(), $stream->getFilename()); } foreach ($node as $n) { @@ -98,7 +98,7 @@ class Twig_TokenParser_For extends Twig_TokenParser if ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name && 'loop' == $node->getNode('node')->getAttribute('name')) { $attribute = $node->getNode('attribute'); if ($attribute instanceof Twig_Node_Expression_Constant && in_array($attribute->getAttribute('value'), array('length', 'revindex0', 'revindex', 'last'))) { - throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition', $attribute->getAttribute('value')), $node->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getLine(), $stream->getFilename()); } } diff --git a/lib/Twig/TokenParser/From.php b/lib/Twig/TokenParser/From.php index ee5402454..f7547ebe3 100644 --- a/lib/Twig/TokenParser/From.php +++ b/lib/Twig/TokenParser/From.php @@ -46,7 +46,7 @@ class Twig_TokenParser_From extends Twig_TokenParser foreach ($targets as $name => $alias) { if ($this->parser->isReservedMacroName($name)) { - throw new Twig_Error_Syntax(sprintf('"%s" cannot be an imported macro as it is a reserved keyword', $name), $token->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax(sprintf('"%s" cannot be an imported macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getFilename()); } $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var')); diff --git a/lib/Twig/TokenParser/If.php b/lib/Twig/TokenParser/If.php index 1f44ce788..91c060498 100644 --- a/lib/Twig/TokenParser/If.php +++ b/lib/Twig/TokenParser/If.php @@ -56,7 +56,7 @@ class Twig_TokenParser_If extends Twig_TokenParser break; default: - throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d)', $lineno), $stream->getCurrent()->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getFilename()); } } diff --git a/lib/Twig/TokenParser/Macro.php b/lib/Twig/TokenParser/Macro.php index 63a2a1b7e..8a7ebd6ed 100644 --- a/lib/Twig/TokenParser/Macro.php +++ b/lib/Twig/TokenParser/Macro.php @@ -35,7 +35,7 @@ class Twig_TokenParser_Macro extends Twig_TokenParser $value = $token->getValue(); if ($value != $name) { - throw new Twig_Error_Syntax(sprintf('Expected endmacro for macro "%s" (but "%s" given)', $name, $value), $stream->getCurrent()->getLine(), $stream->getFilename()); + throw new Twig_Error_Syntax(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getFilename()); } } $this->parser->popLocalScope(); diff --git a/lib/Twig/TokenParser/Sandbox.php b/lib/Twig/TokenParser/Sandbox.php index 998427ffa..1feadd084 100644 --- a/lib/Twig/TokenParser/Sandbox.php +++ b/lib/Twig/TokenParser/Sandbox.php @@ -36,7 +36,7 @@ class Twig_TokenParser_Sandbox extends Twig_TokenParser } if (!$node instanceof Twig_Node_Include) { - throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section', $node->getLine(), $this->parser->getFilename()); + throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section.', $node->getLine(), $this->parser->getFilename()); } } } diff --git a/lib/Twig/TokenStream.php b/lib/Twig/TokenStream.php index 8d2e220fe..016f8122a 100644 --- a/lib/Twig/TokenStream.php +++ b/lib/Twig/TokenStream.php @@ -56,7 +56,7 @@ class Twig_TokenStream public function next() { if (!isset($this->tokens[++$this->current])) { - throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current - 1]->getLine(), $this->filename); + throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->filename); } return $this->tokens[$this->current - 1]; @@ -84,7 +84,7 @@ class Twig_TokenStream $token = $this->tokens[$this->current]; if (!$token->test($type, $value)) { $line = $token->getLine(); - throw new Twig_Error_Syntax(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s)', + throw new Twig_Error_Syntax(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s).', $message ? $message.'. ' : '', Twig_Token::typeToEnglish($token->getType()), $token->getValue(), Twig_Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''), @@ -107,7 +107,7 @@ class Twig_TokenStream public function look($number = 1) { if (!isset($this->tokens[$this->current + $number])) { - throw new Twig_Error_Syntax('Unexpected end of template', $this->tokens[$this->current + $number - 1]->getLine(), $this->filename); + throw new Twig_Error_Syntax('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->filename); } return $this->tokens[$this->current + $number]; diff --git a/test/Twig/Tests/ExpressionParserTest.php b/test/Twig/Tests/ExpressionParserTest.php index 4eaef5391..33bf48be7 100644 --- a/test/Twig/Tests/ExpressionParserTest.php +++ b/test/Twig/Tests/ExpressionParserTest.php @@ -239,7 +239,7 @@ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase /** * @expectedException Twig_Error_Syntax - * @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1 + * @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1. */ public function testMacroDefinitionDoesNotSupportNonNameVariableName() { diff --git a/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test b/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test index 5dd9f3838..9ca418b22 100644 --- a/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test +++ b/test/Twig/Tests/Fixtures/exceptions/syntax_error_in_reused_template.test @@ -7,4 +7,4 @@ Exception for syntax error in reused template {% do node.data = 5 %} {% endblock %} --EXCEPTION-- -Twig_Error_Syntax: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3 +Twig_Error_Syntax: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3. diff --git a/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test b/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test index 47f37e450..0eaabb446 100644 --- a/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test +++ b/test/Twig/Tests/Fixtures/expressions/two_word_operators_as_variables.test @@ -5,4 +5,4 @@ Twig does not allow to use two-word named operators as variable names --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2 +Twig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2. diff --git a/test/Twig/Tests/Fixtures/macros/varargs_argument.test b/test/Twig/Tests/Fixtures/macros/varargs_argument.test index b08c8ec91..9cfbbd205 100644 --- a/test/Twig/Tests/Fixtures/macros/varargs_argument.test +++ b/test/Twig/Tests/Fixtures/macros/varargs_argument.test @@ -4,5 +4,5 @@ macro with varargs argument {% macro test(varargs) %} {% endmacro %} --EXCEPTION-- -Twig_Error_Syntax: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2 +Twig_Error_Syntax: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2. diff --git a/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test b/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test index 5c205c0aa..bc89ec820 100644 --- a/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test +++ b/test/Twig/Tests/Fixtures/tags/block/block_unique_name.test @@ -8,4 +8,4 @@ --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3 +Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3. diff --git a/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test b/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test index 4301ef2ff..6a2af63b6 100644 --- a/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test +++ b/test/Twig/Tests/Fixtures/tags/for/loop_not_defined.test @@ -7,4 +7,4 @@ --DATA-- return array('items' => array('a', 'b')) --EXCEPTION-- -Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3 +Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3. diff --git a/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test b/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test index c7e723a51..1e819ca0a 100644 --- a/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test +++ b/test/Twig/Tests/Fixtures/tags/for/loop_not_defined_cond.test @@ -6,4 +6,4 @@ --DATA-- return array('items' => array('a', 'b')) --EXCEPTION-- -Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2 +Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2. diff --git a/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test b/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test index c9e86b1ae..cca6dbc9b 100644 --- a/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test +++ b/test/Twig/Tests/Fixtures/tags/inheritance/parent_in_a_block.test @@ -5,4 +5,4 @@ {% extends "foo.twig" %} {% endblock %} --EXCEPTION-- -Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3 +Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3. diff --git a/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test b/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test index a9eaa4c13..e29b1ac4b 100644 --- a/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test +++ b/test/Twig/Tests/Fixtures/tags/inheritance/parent_without_extends.test @@ -5,4 +5,4 @@ {{ parent() }} {% endblock %} --EXCEPTION-- -Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3 +Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3. diff --git a/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test b/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test index 6df4f5d6c..2de9765ff 100644 --- a/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test +++ b/test/Twig/Tests/Fixtures/tags/macro/from_with_reserved_name.test @@ -6,4 +6,4 @@ --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2 +Twig_Error_Syntax: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2. diff --git a/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test b/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test index e5aa7498c..7bd93c62d 100644 --- a/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test +++ b/test/Twig/Tests/Fixtures/tags/macro/import_with_reserved_nam.test @@ -8,4 +8,4 @@ --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4 +Twig_Error_Syntax: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4. diff --git a/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test b/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test index a2dde5a50..f7c102f02 100644 --- a/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test +++ b/test/Twig/Tests/Fixtures/tags/macro/reserved_name.test @@ -7,4 +7,4 @@ --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2 +Twig_Error_Syntax: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2. diff --git a/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test b/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test index 2fd9fb26d..99deefc32 100644 --- a/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test +++ b/test/Twig/Tests/Fixtures/tags/raw/mixed_usage_with_raw.legacy.test @@ -7,4 +7,4 @@ --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2 +Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2. diff --git a/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test b/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test index 683c59a0e..dfddc1513 100644 --- a/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test +++ b/test/Twig/Tests/Fixtures/tags/sandbox/not_valid1.test @@ -8,4 +8,4 @@ sandbox tag --TEMPLATE(foo.twig)-- foo --EXCEPTION-- -Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4 +Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4. diff --git a/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test b/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test index 3dcfa88c7..a33a13ee6 100644 --- a/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test +++ b/test/Twig/Tests/Fixtures/tags/sandbox/not_valid2.test @@ -11,4 +11,4 @@ sandbox tag --TEMPLATE(foo.twig)-- foo --EXCEPTION-- -Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5 +Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5. diff --git a/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test b/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test index 941dddcce..28626a816 100644 --- a/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test +++ b/test/Twig/Tests/Fixtures/tags/verbatim/mixed_usage_with_raw.test @@ -7,4 +7,4 @@ --DATA-- return array() --EXCEPTION-- -Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2 +Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2.