mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
minor #3543 Fix typo in CacheTokenParser.php (pulzarraider)
This PR was merged into the 3.x branch.
Discussion
----------
Fix typo in CacheTokenParser.php
Commits
-------
49bac0b1 Fix typo in CacheTokenParser.php
This commit is contained in:
@@ -53,7 +53,7 @@ class FunctionalTest extends TestCase
|
||||
{
|
||||
$twig = $this->createEnvironment(['index' => '{% cache "tags_no_args" tags() %}{% endcache %}']);
|
||||
$this->expectException(SyntaxError::class);
|
||||
$this->expectExceptionMessage('The "ttl" modifier takes exactly one argument (0 given) in "index" at line 1.');
|
||||
$this->expectExceptionMessage('The "tags" modifier takes exactly one argument (0 given) in "index" at line 1.');
|
||||
$twig->render('index');
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class FunctionalTest extends TestCase
|
||||
{
|
||||
$twig = $this->createEnvironment(['index' => '{% cache "tags_too_many_args" tags(["foo"], 1) %}{% endcache %}']);
|
||||
$this->expectException(SyntaxError::class);
|
||||
$this->expectExceptionMessage('The "ttl" modifier takes exactly one argument (2 given) in "index" at line 1.');
|
||||
$this->expectExceptionMessage('The "tags" modifier takes exactly one argument (2 given) in "index" at line 1.');
|
||||
$twig->render('index');
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class CacheTokenParser extends AbstractTokenParser
|
||||
break;
|
||||
case 'tags':
|
||||
if (1 !== \count($args)) {
|
||||
throw new SyntaxError(sprintf('The "ttl" modifier takes exactly one argument (%d given).', \count($args)), $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
||||
throw new SyntaxError(sprintf('The "tags" modifier takes exactly one argument (%d given).', \count($args)), $stream->getCurrent()->getLine(), $stream->getSourceContext());
|
||||
}
|
||||
$tags = $args->getNode(0);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user