ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Node_Expression_Test Class Reference
+ Inheritance diagram for Twig_Node_Expression_Test:
+ Collaboration diagram for Twig_Node_Expression_Test:

Public Member Functions

 __construct (Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments=null, $lineno)
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
- Public Member Functions inherited from Twig_Node
 __construct (array $nodes=array(), array $attributes=array(), $lineno=0, $tag=null)
 Constructor. More...
 
 __toString ()
 
 toXml ($asDom=false)
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
 getTemplateLine ()
 
 getLine ()
 
 getNodeTag ()
 
 hasAttribute ($name)
 
 getAttribute ($name)
 
 setAttribute ($name, $value)
 
 removeAttribute ($name)
 
 hasNode ($name)
 
 getNode ($name)
 
 setNode ($name, $node=null)
 
 removeNode ($name)
 
 count ()
 
 getIterator ()
 
 setTemplateName ($name)
 
 getTemplateName ()
 
 setFilename ($name)
 
 getFilename ()
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
 getLine ()
 
 getNodeTag ()
 

Additional Inherited Members

- Protected Member Functions inherited from Twig_Node_Expression_Call
 compileCallable (Twig_Compiler $compiler)
 
 compileArguments (Twig_Compiler $compiler)
 
 getArguments ($callable, $arguments)
 
 normalizeName ($name)
 
- Protected Attributes inherited from Twig_Node
 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Definition at line 11 of file Test.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Node_Expression_Test::__construct ( Twig_NodeInterface  $node,
  $name,
Twig_NodeInterface  $arguments = null,
  $lineno 
)

Reimplemented in Twig_Node_Expression_Test_Defined.

Definition at line 13 of file Test.php.

14 {
15 $nodes = array('node' => $node);
16 if (null !== $arguments) {
17 $nodes['arguments'] = $arguments;
18 }
19
20 parent::__construct($nodes, array('name' => $name), $lineno);
21 }
$lineno
Definition: Node.php:22
$nodes
Definition: Node.php:20

References Twig_Node\$lineno, Twig_Node\$name, and Twig_Node\$nodes.

Member Function Documentation

◆ compile()

Twig_Node_Expression_Test::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Reimplemented from Twig_Node.

Reimplemented in Twig_Node_Expression_Test_Constant, Twig_Node_Expression_Test_Defined, Twig_Node_Expression_Test_Divisibleby, Twig_Node_Expression_Test_Even, Twig_Node_Expression_Test_Null, Twig_Node_Expression_Test_Odd, and Twig_Node_Expression_Test_Sameas.

Definition at line 23 of file Test.php.

24 {
25 $name = $this->getAttribute('name');
26 $test = $compiler->getEnvironment()->getTest($name);
27
28 $this->setAttribute('name', $name);
29 $this->setAttribute('type', 'test');
30 $this->setAttribute('thing', $test);
31 if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) {
32 $this->setAttribute('callable', $test->getCallable());
33 }
34 if ($test instanceof Twig_SimpleTest) {
35 $this->setAttribute('is_variadic', $test->isVariadic());
36 }
37
38 $this->compileCallable($compiler);
39 }
$test
Definition: Utf8Test.php:84
getEnvironment()
Returns the environment instance related to this compiler.
Definition: Compiler.php:50
compileCallable(Twig_Compiler $compiler)
Definition: Call.php:15
getAttribute($name)
Definition: Node.php:152
setAttribute($name, $value)
Definition: Node.php:165
Represents a template test.
Definition: SimpleTest.php:20
Represents a callable template test.

References Twig_Node\$name, $test, Twig_Node_Expression_Call\compileCallable(), Twig_Node\getAttribute(), Twig_Compiler\getEnvironment(), and Twig_Node\setAttribute().

+ Here is the call graph for this function:

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