);
}
- public function parseNotTestExpression(Twig_Parser $parser, $node)
+ public function parseNotTestExpression(Twig_Parser $parser, Twig_NodeInterface $node)
{
return new Twig_Node_Expression_Unary_Not($this->parseTestExpression($parser, $node), $parser->getCurrentToken()->getLine());
}
- public function parseTestExpression(Twig_Parser $parser, $node)
+ public function parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $node)
{
$stream = $parser->getStream();
$name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
return $node;
}
- protected function optimizeVariables($node, $env)
+ protected function optimizeVariables(Twig_NodeInterface $node, Twig_Environment $env)
{
if ('Twig_Node_Expression_Name' === get_class($node) && $node->isSimple()) {
$this->prependedNodes[0][] = $node->getAttribute('name');
* @param Twig_NodeInterface $node A Node
* @param Twig_Environment $env The current Twig environment
*/
- protected function optimizePrintNode($node, $env)
+ protected function optimizePrintNode(Twig_NodeInterface $node, Twig_Environment $env)
{
if (!$node instanceof Twig_Node_Print) {
return $node;
* @param Twig_NodeInterface $node A Node
* @param Twig_Environment $env The current Twig environment
*/
- protected function optimizeRawFilter($node, $env)
+ protected function optimizeRawFilter(Twig_NodeInterface $node, Twig_Environment $env)
{
if ($node instanceof Twig_Node_Expression_Filter && 'raw' == $node->getNode('filter')->getAttribute('value')) {
return $node->getNode('node');
* @param Twig_NodeInterface $node A Node
* @param Twig_Environment $env The current Twig environment
*/
- protected function enterOptimizeFor($node, $env)
+ protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
{
if ($node instanceof Twig_Node_For) {
// disable the loop variable by default
* @param Twig_NodeInterface $node A Node
* @param Twig_Environment $env The current Twig environment
*/
- protected function leaveOptimizeFor($node, $env)
+ protected function leaveOptimizeFor(Twig_NodeInterface $node, Twig_Environment $env)
{
if ($node instanceof Twig_Node_For) {
array_shift($this->loops);
return $this->blocks[$name];
}
- public function setBlock($name, $value)
+ public function setBlock($name, Twig_Node_Block $value)
{
$this->blocks[$name] = new Twig_Node_Body(array($value), array(), $value->getLine());
}
*
* @param integer $type The type as an integer
* @param Boolean $short Whether to return a short representation or not
- * @param integer $line The code line
*
* @return string The string representation
*/
- public static function typeToString($type, $short = false, $line = -1)
+ public static function typeToString($type, $short = false)
{
switch ($type) {
case self::EOF_TYPE:
* Returns the english representation of a given type.
*
* @param integer $type The type as an integer
- * @param integer $line The code line
*
* @return string The string representation
*/
- public static function typeToEnglish($type, $line = -1)
+ public static function typeToEnglish($type)
{
switch ($type) {
case self::EOF_TYPE: