mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
adding missing dots to some exception messages
This commit is contained in:
@@ -270,7 +270,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
{
|
||||
// can't outdent by more steps than the current indentation level
|
||||
if ($this->indentation < $step) {
|
||||
throw new LogicException('Unable to call outdent() as the indentation would become negative');
|
||||
throw new LogicException('Unable to call outdent() as the indentation would become negative.');
|
||||
}
|
||||
|
||||
$this->indentation -= $step;
|
||||
|
||||
@@ -1045,7 +1045,7 @@ class Twig_Environment
|
||||
public function addTest($name, $test = null)
|
||||
{
|
||||
if (!$name instanceof Twig_SimpleTest && !($test instanceof Twig_SimpleTest || $test instanceof Twig_TestInterface)) {
|
||||
throw new LogicException('A test must be an instance of Twig_TestInterface or Twig_SimpleTest');
|
||||
throw new LogicException('A test must be an instance of Twig_TestInterface or Twig_SimpleTest.');
|
||||
}
|
||||
|
||||
if ($name instanceof Twig_SimpleTest) {
|
||||
@@ -1109,7 +1109,7 @@ class Twig_Environment
|
||||
public function addFunction($name, $function = null)
|
||||
{
|
||||
if (!$name instanceof Twig_SimpleFunction && !($function instanceof Twig_SimpleFunction || $function instanceof Twig_FunctionInterface)) {
|
||||
throw new LogicException('A function must be an instance of Twig_FunctionInterface or Twig_SimpleFunction');
|
||||
throw new LogicException('A function must be an instance of Twig_FunctionInterface or Twig_SimpleFunction.');
|
||||
}
|
||||
|
||||
if ($name instanceof Twig_SimpleFunction) {
|
||||
@@ -1407,7 +1407,7 @@ class Twig_Environment
|
||||
|
||||
$this->parsers->addTokenParserBroker($parser);
|
||||
} else {
|
||||
throw new LogicException('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances');
|
||||
throw new LogicException('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ class Twig_ExpressionParser
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new Twig_Error_Syntax('Expected name or number', $lineno, $this->parser->getFilename());
|
||||
throw new Twig_Error_Syntax('Expected name or number.', $lineno, $this->parser->getFilename());
|
||||
}
|
||||
|
||||
if ($node instanceof Twig_Node_Expression_Name && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
|
||||
@@ -541,7 +541,7 @@ class Twig_ExpressionParser
|
||||
$token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to');
|
||||
$value = $token->getValue();
|
||||
if (in_array(strtolower($value), array('true', 'false', 'none', 'null'))) {
|
||||
throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $value), $token->getLine(), $this->parser->getFilename());
|
||||
throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $this->parser->getFilename());
|
||||
}
|
||||
$targets[] = new Twig_Node_Expression_AssignName($value, $token->getLine());
|
||||
|
||||
|
||||
+1
-1
@@ -403,7 +403,7 @@ class Twig_Lexer implements Twig_LexerInterface
|
||||
protected function popState()
|
||||
{
|
||||
if (0 === count($this->states)) {
|
||||
throw new Exception('Cannot pop state without a previous state');
|
||||
throw new Exception('Cannot pop state without a previous state.');
|
||||
}
|
||||
|
||||
$this->state = array_pop($this->states);
|
||||
|
||||
@@ -419,7 +419,7 @@ class Twig_Node_Module extends Twig_Node
|
||||
->raw(");\n")
|
||||
;
|
||||
} else {
|
||||
throw new LogicException('Trait templates can only be constant nodes');
|
||||
throw new LogicException('Trait templates can only be constant nodes.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
} elseif (false !== $parent = $this->getParent($context)) {
|
||||
$parent->displayBlock($name, $context, $blocks, false);
|
||||
} else {
|
||||
throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName());
|
||||
throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getTemplateName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
|
||||
.chr($codepoint >> 6 & 0x3f | 0x80)
|
||||
.chr($codepoint & 0x3f | 0x80);
|
||||
}
|
||||
throw new Exception('Codepoint requested outside of Unicode range');
|
||||
throw new Exception('Codepoint requested outside of Unicode range.');
|
||||
}
|
||||
|
||||
public function testJavascriptEscapingEscapesOwaspRecommendedRanges()
|
||||
|
||||
Reference in New Issue
Block a user