Debian Codegraph @

vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php

raw
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\Node\Expr;
4
5 use PhpParser\Node\Expr;
6
7 abstract class BinaryOp extends Expr {
8 /** @var Expr The left hand side expression */
9 public Expr $left;
10 /** @var Expr The right hand side expression */
11 public Expr $right;
12
13 /**
14 * Constructs a binary operator node.
15 *
16 * @param Expr $left The left hand side expression
17 * @param Expr $right The right hand side expression
18 * @param array<string, mixed> $attributes Additional attributes
19 */
20 public function __construct(Expr $left, Expr $right, array $attributes = []) {
21 $this->attributes = $attributes;
22 $this->left = $left;
23 $this->right = $right;
24 }
25
26 public function getSubNodeNames(): array {
27 return ['left', 'right'];
28 }
29
30 /**
31 * Get the operator sigil for this binary operation.
32 *
33 * In the case there are multiple possible sigils for an operator, this method does not
34 * necessarily return the one used in the parsed code.
35 */
36 abstract public function getOperatorSigil(): string;
37 }