Pinq\Expressions\Expression::unaryOperation PHP Method

unaryOperation() final public static method

final public static unaryOperation ( string $unaryOperator, Expression $operand ) : UnaryOperationExpression
$unaryOperator string
$operand Expression
return UnaryOperationExpression
    public static final function unaryOperation($unaryOperator, Expression $operand)
    {
        return new UnaryOperationExpression($unaryOperator, $operand);
    }

Usage Example

コード例 #1
0
ファイル: ComplexParserTest.php プロジェクト: timetoogo/pinq
 /**
  * @dataProvider parsers
  */
 public function testNestedUnaryOperators()
 {
     $function = function () {
         -+-+-+$i++;
     };
     $this->assertParsedAs($function, [O\Expression::unaryOperation(O\Operators\Unary::NEGATION, O\Expression::unaryOperation(O\Operators\Unary::PLUS, O\Expression::unaryOperation(O\Operators\Unary::NEGATION, O\Expression::unaryOperation(O\Operators\Unary::PLUS, O\Expression::unaryOperation(O\Operators\Unary::NEGATION, O\Expression::unaryOperation(O\Operators\Unary::PLUS, O\Expression::unaryOperation(O\Operators\Unary::INCREMENT, self::variable('i'))))))))]);
 }
All Usage Examples Of Pinq\Expressions\Expression::unaryOperation