Example #1
0
 /**
  * @param   string   $operand
  * @return  File
  */
 public function __construct($operator, $operand, $isParentheses = false)
 {
     $this->setOperator($operator);
     parent::__construct($operand, $isParentheses);
 }
Example #2
0
 /**
  * Because we are extending the BasicExpr our left operand is its only
  * only operand so we will reuse that and only write a setter for the
  * right
  *
  * @param   string | object		$leftOp
  * @param	string				$operator
  * @parma	string | object		$rightOp
  * @param	bool				$isPar		flag or using parentheses
  * @return  BinaryExpr
  */
 public function __construct($leftOp, $operator, $rightOp, $isPar = false)
 {
     $this->setOperator($operator);
     $this->setRightOperand($rightOp);
     parent::__construct($leftOp, $isPar);
 }
Example #3
0
 /**
  * @return null
  */
 public function testIsEnableDisableParentheses()
 {
     $op = 'my value';
     $expr = new BasicExpr($op);
     $this->assertFalse($expr->isParentheses());
     $this->assertSame($expr, $expr->enableParentheses());
     $this->assertTrue($expr->isParentheses());
     $expected = "({$op})";
     $this->assertEquals($expected, $expr->build());
     $this->assertSame($expr, $expr->disableParentheses());
     $this->assertFalse($expr->isParentheses());
     $this->assertEquals($op, $expr->build());
     $expr = new BasicExpr($op, true);
     $this->assertTrue($expr->isParentheses());
     $this->assertEquals($expected, $expr->build());
 }