Skip to content

Commit

Permalink
Add never
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed May 10, 2024
1 parent a266eac commit 9e0af26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/web/twig/tokenparsers/CacheResponseTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public function parse(Token $token): CacheResponseNode
'durationUnit' => null,
];

if ($stream->test(Token::NAME_TYPE, 'for')) {
if ($stream->test(Token::NAME_TYPE, 'never')) {
$stream->next();
$attributes['durationNum'] = 0;
} elseif ($stream->test(Token::NAME_TYPE, 'for')) {
$stream->next();
$attributes['durationNum'] = $stream->expect(Token::NUMBER_TYPE)->getValue();
$attributes['durationUnit'] = $stream->expect(Token::NAME_TYPE,
Expand Down

0 comments on commit 9e0af26

Please sign in to comment.