2017-08-18 22:57:27 +02:00
|
|
|
<?php declare(strict_types=1);
|
2014-02-06 14:44:16 +01:00
|
|
|
|
|
|
|
namespace PhpParser\Node\Expr;
|
|
|
|
|
|
|
|
use PhpParser\Node\Expr;
|
|
|
|
|
2015-01-17 23:38:59 +01:00
|
|
|
abstract class BinaryOp extends Expr
|
2014-02-06 14:44:16 +01:00
|
|
|
{
|
2015-02-28 18:44:28 +01:00
|
|
|
/** @var Expr The left hand side expression */
|
|
|
|
public $left;
|
|
|
|
/** @var Expr The right hand side expression */
|
|
|
|
public $right;
|
|
|
|
|
2014-02-06 14:44:16 +01:00
|
|
|
/**
|
|
|
|
* Constructs a bitwise and node.
|
|
|
|
*
|
|
|
|
* @param Expr $left The left hand side expression
|
|
|
|
* @param Expr $right The right hand side expression
|
|
|
|
* @param array $attributes Additional attributes
|
|
|
|
*/
|
2017-08-13 14:06:08 +02:00
|
|
|
public function __construct(Expr $left, Expr $right, array $attributes = []) {
|
2015-05-02 22:17:34 +02:00
|
|
|
parent::__construct($attributes);
|
2015-02-28 18:44:28 +01:00
|
|
|
$this->left = $left;
|
|
|
|
$this->right = $right;
|
|
|
|
}
|
|
|
|
|
2017-04-28 21:40:59 +02:00
|
|
|
public function getSubNodeNames() : array {
|
2017-08-13 14:06:08 +02:00
|
|
|
return ['left', 'right'];
|
2014-02-06 14:44:16 +01:00
|
|
|
}
|
2017-09-30 18:56:44 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the operator sigil for this binary operation.
|
|
|
|
*
|
|
|
|
* In the case there are multiple possible sigils for an operator, this method does not
|
|
|
|
* necessarily return the one used in the parsed code.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
abstract public function getOperatorSigil() : string;
|
2015-01-17 23:38:59 +01:00
|
|
|
}
|