mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 03:57:21 +00:00
added type hints
This commit is contained in:
@@ -30,7 +30,7 @@ use Twig\Token;
|
||||
*/
|
||||
final class IfTokenParser extends AbstractTokenParser
|
||||
{
|
||||
public function parse(Token $token)
|
||||
public function parse(Token $token): Node
|
||||
{
|
||||
$lineno = $token->getLine();
|
||||
$expr = $this->parser->getExpressionParser()->parseExpression();
|
||||
@@ -70,17 +70,17 @@ final class IfTokenParser extends AbstractTokenParser
|
||||
return new IfNode(new Node($tests), $else, $lineno, $this->getTag());
|
||||
}
|
||||
|
||||
public function decideIfFork(Token $token)
|
||||
public function decideIfFork(Token $token): bool
|
||||
{
|
||||
return $token->test(['elseif', 'else', 'endif']);
|
||||
}
|
||||
|
||||
public function decideIfEnd(Token $token)
|
||||
public function decideIfEnd(Token $token): bool
|
||||
{
|
||||
return $token->test(['endif']);
|
||||
}
|
||||
|
||||
public function getTag()
|
||||
public function getTag(): string
|
||||
{
|
||||
return 'if';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user