Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/LogicalExpression.php

raw
1 <?php
2 /**
3 * This file is part of the Peast package
4 *
5 * (c) Marco Marchiò <[email protected]>
6 *
7 * For the full copyright and license information refer to the LICENSE file
8 * distributed with this source code
9 */
10 namespace Peast\Syntax\Node;
11
12 /**
13 * A node that represents a logical expression.
14 * For example: a && b
15 *
16 * @author Marco Marchiò <[email protected]>
17 */
18 class LogicalExpression extends Node implements Expression
19 {
20 /**
21 * Map of node properties
22 *
23 * @var array
24 */
25 protected $propertiesMap = array(
26 "left" => true,
27 "operator" => false,
28 "right" => true
29 );
30
31 /**
32 * Operator
33 *
34 * @var string
35 */
36 protected $operator;
37
38 /**
39 * Left expression
40 *
41 * @var Expression
42 */
43 protected $left;
44
45 /**
46 * Right expression
47 *
48 * @var Expression
49 */
50 protected $right;
51
52 /**
53 * Returns the operator
54 *
55 * @return string
56 */
57 public function getOperator()
58 {
59 return $this->operator;
60 }
61
62 /**
63 * Sets the operator
64 *
65 * @param string $operator Operator
66 *
67 * @return $this
68 */
69 public function setOperator($operator)
70 {
71 $this->operator = $operator;
72 return $this;
73 }
74
75 /**
76 * Returns the left expression
77 *
78 * @return Expression
79 */
80 public function getLeft()
81 {
82 return $this->left;
83 }
84
85 /**
86 * Sets the left expression
87 *
88 * @param Expression $left Left expression
89 *
90 * @return $this
91 */
92 public function setLeft(Expression $left)
93 {
94 $this->left = $left;
95 return $this;
96 }
97
98 /**
99 * Returns the right expression
100 *
101 * @return Expression
102 */
103 public function getRight()
104 {
105 return $this->right;
106 }
107
108 /**
109 * Sets the right expression
110 *
111 * @param Expression $right Right expression
112 *
113 * @return $this
114 */
115 public function setRight(Expression $right)
116 {
117 $this->right = $right;
118 return $this;
119 }
120 }