4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\ExpressionLanguage\Node;
14 use Symfony\Component\ExpressionLanguage\Compiler;
17 * @author Fabien Potencier <fabien@symfony.com>
21 class UnaryNode extends Node
23 private static $operators = array(
30 public function __construct($operator, Node $node)
33 array('node' => $node),
34 array('operator' => $operator)
38 public function compile(Compiler $compiler)
42 ->raw(self::$operators[$this->attributes['operator']])
43 ->compile($this->nodes['node'])
48 public function evaluate($functions, $values)
50 $value = $this->nodes['node']->evaluate($functions, $values);
51 switch ($this->attributes['operator']) {