Exemple #1
0
 /**
  * CommentNode constructor.
  *
  * @param string $comment
  * @param int    $lineNo
  */
 public function __construct($comment, $lineNo)
 {
     parent::__construct([], [self::ATTR_COMMENT => $comment], $lineNo);
 }
Exemple #2
0
 /**
  * ArrayNode constructor.
  *
  * @param array $elements
  * @param int   $lineNo
  */
 public function __construct(array $elements, $lineNo)
 {
     parent::__construct([self::NODE_ELEMENTS => $elements], [], $lineNo);
 }
Exemple #3
0
 /**
  * PrintNode constructor.
  *
  * @param Node  $expr
  * @param int   $lineNo
  */
 public function __construct(Node $expr, $lineNo)
 {
     parent::__construct([self::NODE_EXPRESSION => $expr], [], $lineNo);
 }
Exemple #4
0
 /**
  * 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);
 }
Exemple #5
0
 /**
  * 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);
 }
Exemple #6
0
 /**
  * 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);
 }
Exemple #7
0
 /**
  * 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);
 }
Exemple #8
0
 /**
  * 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);
 }
Exemple #9
0
 /**
  * SandboxNode constructor.
  * @param Node $body
  * @param int  $lineNo
  */
 function __construct(Node $body, $lineNo)
 {
     parent::__construct([], [], $lineNo);
     $this->body = $body;
     $this->lineNo = $lineNo;
 }
Exemple #10
0
 /**
  * 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);
 }
Exemple #11
0
 /**
  * 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);
 }
Exemple #12
0
 /**
  * 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);
 }
Exemple #13
0
 /**
  * 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);
 }
Exemple #14
0
 /**
  * Text constructor.
  *
  * @param string    $text
  * @param int       $lineNo
  */
 public function __construct($text, $lineNo)
 {
     parent::__construct([], ['text' => $text], $lineNo);
 }
Exemple #15
0
 /**
  * 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);
 }
Exemple #16
0
 /**
  * Name constructor.
  *
  * @param string $name
  * @param int    $lineNo
  */
 public function __construct($name, $lineNo)
 {
     parent::__construct([], [self::ATTR_NAME => $name], $lineNo);
 }
Exemple #17
0
 /**
  * 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);
 }
Exemple #18
0
 /**
  * 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);
 }