mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
added type hints
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Twig\TokenParser;
|
||||
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\WithNode;
|
||||
use Twig\Token;
|
||||
|
||||
@@ -21,7 +22,7 @@ use Twig\Token;
|
||||
*/
|
||||
final class WithTokenParser extends AbstractTokenParser
|
||||
{
|
||||
public function parse(Token $token)
|
||||
public function parse(Token $token): Node
|
||||
{
|
||||
$stream = $this->parser->getStream();
|
||||
|
||||
@@ -41,12 +42,12 @@ final class WithTokenParser extends AbstractTokenParser
|
||||
return new WithNode($body, $variables, $only, $token->getLine(), $this->getTag());
|
||||
}
|
||||
|
||||
public function decideWithEnd(Token $token)
|
||||
public function decideWithEnd(Token $token): bool
|
||||
{
|
||||
return $token->test('endwith');
|
||||
}
|
||||
|
||||
public function getTag()
|
||||
public function getTag(): string
|
||||
{
|
||||
return 'with';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user