/** * CommentNode constructor. * * @param string $comment * @param int $lineNo */ public function __construct($comment, $lineNo) { parent::__construct([], [self::ATTR_COMMENT => $comment], $lineNo); }
/** * ArrayNode constructor. * * @param array $elements * @param int $lineNo */ public function __construct(array $elements, $lineNo) { parent::__construct([self::NODE_ELEMENTS => $elements], [], $lineNo); }
/** * PrintNode constructor. * * @param Node $expr * @param int $lineNo */ public function __construct(Node $expr, $lineNo) { parent::__construct([self::NODE_EXPRESSION => $expr], [], $lineNo); }
/** * Template constructor. * * @param array|\Azera\Fry\Node[] $name * @param Node $parent * @param Node $body * @param Node[] $blocks * @param Node[] $macros */ public function __construct($name, Node $parent = null, Node $body, array $blocks = [], array $macros = []) { parent::__construct([self::NODE_BODY => $body, self::NODE_BLOCKS => $blocks, self::NODE_MACROS => $macros, self::NODE_PARENT => $parent], [self::ATTR_NAME => $name ?: md5(rand(1000, 9999))], null); }
/** * LoopNode constructor. * * @param string $key * @param string $value * @param Node $repo * @param Node $body * @param $lineNo */ public function __construct($key, $value, Node $repo, Node $body, $lineNo) { parent::__construct([self::NODE_BODY => $body, self::NODE_REPO => $repo], [self::ATTR_KEY => $key, self::ATTR_VALUE => $value], $lineNo); }
/** * Arguments constructor. * * @param array $args * @param bool $definition * @param int $lineNo */ public function __construct(array $args = [], $definition = false, $lineNo = null) { parent::__construct($args, [self::ATTR_DEFINITION => $definition], $lineNo); }
/** * Binary constructor. * * @param Node $node_1 * @param Node $node_2 * @param string $operator * @param int $lineNo */ public function __construct($node_1, $node_2, $operator, $lineNo) { parent::__construct([self::NODE_1 => $node_1, self::NODE_2 => $node_2], [self::ATTR_OPERATOR => $operator], $lineNo); }
/** * Operand constructor. * * @param array|\Azera\Fry\Node[] $nodes * @param array $operators * @param int $lineNo */ public function __construct($nodes, $operators, $lineNo) { parent::__construct($nodes, ['operators' => $operators], $lineNo); }
/** * SandboxNode constructor. * @param Node $body * @param int $lineNo */ function __construct(Node $body, $lineNo) { parent::__construct([], [], $lineNo); $this->body = $body; $this->lineNo = $lineNo; }
/** * RenderBlock constructor. * * @param string $blockName * @param Node $context * @param int $lineNo */ public function __construct($blockName, $context, $lineNo) { parent::__construct([self::NODE_CONTEXT => $context], [self::ATTR_NAME => $blockName], $lineNo); }
/** * Constant constructor. * * @param string $constant * @param int $lineNo * @param int $type */ public function __construct($constant, $lineNo, $type = self::TYPE_RAW) { parent::__construct([], [self::ATTR_CONSTANT => $constant, self::ATTR_TYPE => $type], $lineNo); }
/** * Macro constructor. * * @param string $name * @param Node $args * @param Node $body * @param int $lineNo */ public function __construct($name, Node $args, Node $body, $lineNo) { parent::__construct([self::NODE_BODY => $body, self::NODE_ARGS => $args], [self::ATTR_NAME => $name], $lineNo); }
/** * SetNode constructor. * * @param string $var * @param Node $value * @param bool $isBlock * @param int $lineNo */ public function __construct($var, Node $value, $isBlock, $lineNo) { parent::__construct([self::NODE_VALUE => $value], [self::ATTR_VARIABLE => $var, self::ATTR_IS_BLOCK => $isBlock], $lineNo); }
/** * Text constructor. * * @param string $text * @param int $lineNo */ public function __construct($text, $lineNo) { parent::__construct([], ['text' => $text], $lineNo); }
/** * IfSection constructor. * * @param Node[] $tests * @param Node|null $else * @param int $lineNo */ public function __construct(array $tests, $else = null, $lineNo) { parent::__construct([self::NODE_TESTS => $tests, self::NODE_ELSE => $else], [], $lineNo); }
/** * Name constructor. * * @param string $name * @param int $lineNo */ public function __construct($name, $lineNo) { parent::__construct([], [self::ATTR_NAME => $name], $lineNo); }
/** * Filter constructor. * * @param Node $node * @param string $name * @param Node $arguments * @param int $lineNo */ public function __construct($node, $name, $arguments, $lineNo) { parent::__construct([self::NODE_CONTENT => $node, self::NODE_ARGUMENTS => $arguments], [self::ATTR_NAME => $name], $lineNo); }
/** * Block constructor. * * @param Node $body * @param string $name * @param int $lineNo */ public function __construct($body, $name, $lineNo) { parent::__construct([self::NODE_BODY => $body], [self::ATTR_NAME => $name], $lineNo); }