| @@ 217-228 (lines=12) @@ | ||
| 214 | * |
|
| 215 | * @return string |
|
| 216 | */ |
|
| 217 | public function onLogicalExpression($expressionType, $left, $right) |
|
| 218 | { |
|
| 219 | $type = $this->unpackExpressionType($expressionType); |
|
| 220 | switch ($type) { |
|
| 221 | case ExpressionType::AND_LOGICAL: |
|
| 222 | return $this->prepareBinaryExpression(self::LOGICAL_AND, $left, $right); |
|
| 223 | case ExpressionType::OR_LOGICAL: |
|
| 224 | return $this->prepareBinaryExpression(self::LOGICAL_OR, $left, $right); |
|
| 225 | default: |
|
| 226 | throw new \InvalidArgumentException('onLogicalExpression'); |
|
| 227 | } |
|
| 228 | } |
|
| 229 | /** |
|
| 230 | * Call-back for arithmetic expression. |
|
| 231 | * |
|
| @@ 293-304 (lines=12) @@ | ||
| 290 | * |
|
| 291 | * @return string |
|
| 292 | */ |
|
| 293 | public function onUnaryExpression($expressionType, $child) |
|
| 294 | { |
|
| 295 | $type = $this->unpackExpressionType($expressionType); |
|
| 296 | switch ($type) { |
|
| 297 | case ExpressionType::NEGATE: |
|
| 298 | return $this->prepareUnaryExpression(self::NEGATE, $child); |
|
| 299 | case ExpressionType::NOT_LOGICAL: |
|
| 300 | return $this->prepareUnaryExpression(self::LOGICAL_NOT, $child); |
|
| 301 | default: |
|
| 302 | throw new \InvalidArgumentException('onUnaryExpression'); |
|
| 303 | } |
|
| 304 | } |
|
| 305 | /** |
|
| 306 | * Call-back for constant expression. |
|
| 307 | * |
|