ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_TokenParser_With Class Reference

Creates a nested scope. More...

+ Inheritance diagram for Twig_TokenParser_With:
+ Collaboration diagram for Twig_TokenParser_With:

Public Member Functions

 parse (Twig_Token $token)
 Parses a token and returns a node. More...
 
 decideWithEnd (Twig_Token $token)
 
 getTag ()
 Gets the tag name associated with this token parser. More...
 
- Public Member Functions inherited from Twig_TokenParser
 setParser (Twig_Parser $parser)
 Sets the parser associated with this token parser. More...
 
 setParser (Twig_Parser $parser)
 Sets the parser associated with this token parser. More...
 
 parse (Twig_Token $token)
 Parses a token and returns a node. More...
 
 getTag ()
 Gets the tag name associated with this token parser. More...
 

Additional Inherited Members

- Protected Attributes inherited from Twig_TokenParser
 $parser
 

Detailed Description

Creates a nested scope.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

@final

Definition at line 19 of file With.php.

Member Function Documentation

◆ decideWithEnd()

Twig_TokenParser_With::decideWithEnd ( Twig_Token  $token)

Definition at line 41 of file With.php.

42 {
43 return $token->test('endwith');
44 }

References PHPMailer\PHPMailer\$token.

◆ getTag()

Twig_TokenParser_With::getTag ( )

Gets the tag name associated with this token parser.

Returns
string The tag name

Implements Twig_TokenParserInterface.

Definition at line 46 of file With.php.

47 {
48 return 'with';
49 }

◆ parse()

Twig_TokenParser_With::parse ( Twig_Token  $token)

Parses a token and returns a node.

Returns
Twig_NodeInterface
Exceptions
Twig_Error_Syntax

Implements Twig_TokenParserInterface.

Definition at line 21 of file With.php.

22 {
23 $stream = $this->parser->getStream();
24
25 $variables = null;
26 $only = false;
28 $variables = $this->parser->getExpressionParser()->parseExpression();
29 $only = $stream->nextIf(Twig_Token::NAME_TYPE, 'only');
30 }
31
33
34 $body = $this->parser->subparse(array($this, 'decideWithEnd'), true);
35
37
38 return new Twig_Node_With($body, $variables, $only, $token->getLine(), $this->getTag());
39 }
Represents a nested "with" scope.
Definition: With.php:18
const BLOCK_END_TYPE
Definition: Token.php:30
const NAME_TYPE
Definition: Token.php:32
$stream
PHP stream implementation.

References GuzzleHttp\Psr7\$stream, PHPMailer\PHPMailer\$token, Twig_Token\BLOCK_END_TYPE, and Twig_Token\NAME_TYPE.


The documentation for this class was generated from the following file: