Project

General

Profile

1
<?php
2

    
3
/*
4
 * This file is part of Twig.
5
 *
6
 * (c) Fabien Potencier
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
class Twig_Node_Expression_NullCoalesce extends Twig_Node_Expression_Conditional
12
{
13
    public function __construct(Twig_NodeInterface $left, Twig_NodeInterface $right, $lineno)
14
    {
15
        $test = new Twig_Node_Expression_Binary_And(
16
            new Twig_Node_Expression_Test_Defined(clone $left, 'defined', new Twig_Node(), $left->getLine()),
17
            new Twig_Node_Expression_Unary_Not(new Twig_Node_Expression_Test_Null($left, 'null', new Twig_Node(), $left->getLine()), $left->getLine()),
18
            $left->getLine()
19
        );
20

    
21
        parent::__construct($test, $left, $right, $lineno);
22
    }
23
}
(14-14/18)