Completed
Push — master ( 5fbcda...574d76 )
by Nikolay
02:55
created
src/POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionLexer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         while ($this->_token->Id == ExpressionTokenId::DOT) {
352 352
             $this->nextToken();
353 353
             $this->validateToken(ExpressionTokenId::IDENTIFIER);
354
-            $identifier = $identifier . '.' . $this->_token->Text;
354
+            $identifier = $identifier.'.'.$this->_token->Text;
355 355
             $this->nextToken();
356 356
         }
357 357
 
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
             || strcasecmp('X', $tokenText) == 0 
459 459
             || strcasecmp('x', $tokenText) == 0
460 460
         ) {
461
-            $id =  ExpressionTokenId::BINARY_LITERAL;
461
+            $id = ExpressionTokenId::BINARY_LITERAL;
462 462
         } else {
463 463
             return;
464 464
         }
Please login to merge, or discard this patch.
POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $this->_lexer->nextToken();
203 203
             $right = $this->_parseComparison();
204 204
             FunctionDescription::verifyLogicalOpArguments($logicalOpToken, $left, $right);
205
-            $left = new LogicalExpression($left, $right, ExpressionType::AND_LOGICAL );
205
+            $left = new LogicalExpression($left, $right, ExpressionType::AND_LOGICAL);
206 206
         }
207 207
 
208 208
         $this->_recurseLeave();
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             if ($additiveToken->identifierIs(ODataConstants::KEYWORD_ADD)) {
251 251
                 $left = new ArithmeticExpression($left, $right, ExpressionType::ADD, $opReturnType);
252 252
             } else {
253
-                $left = new ArithmeticExpression($left, $right, ExpressionType::SUBTRACT, $opReturnType );
253
+                $left = new ArithmeticExpression($left, $right, ExpressionType::SUBTRACT, $opReturnType);
254 254
             }
255 255
         }
256 256
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                 && (ExpressionLexer::isNumeric($this->_getCurrentToken()->Id))
309 309
             ) {
310 310
                 $numberLiteral = $this->_getCurrentToken();
311
-                $numberLiteral->Text = '-' . $numberLiteral->Text;
311
+                $numberLiteral->Text = '-'.$numberLiteral->Text;
312 312
                 $numberLiteral->Position = $op->Position;
313 313
                 $v = $this->_getCurrentToken();
314 314
                 $this->_setCurrentToken($numberLiteral);
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
         $dateTime = new DateTime();
671 671
         if ($left->typeIs($dateTime) && $right->typeIs($dateTime)) {
672 672
             $dateTimeCmpFunctions = FunctionDescription::dateTimeComparisonFunctions();
673
-            $left = new FunctionCallExpression( $dateTimeCmpFunctions[0], array($left, $right));
673
+            $left = new FunctionCallExpression($dateTimeCmpFunctions[0], array($left, $right));
674 674
             $right = new ConstantExpression(0, new Int32());
675 675
         }
676 676
 
Please login to merge, or discard this patch.
POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionParser2.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
         $expressionProcessor = new ExpressionProcessor($expressionProvider);
94 94
 
95 95
         try {
96
-            $expressionAsString = $expressionProcessor->processExpression( $expressionTree );
96
+            $expressionAsString = $expressionProcessor->processExpression($expressionTree);
97 97
         } catch (\InvalidArgumentException $invalidArgumentException) {
98
-            throw ODataException::createInternalServerError( $invalidArgumentException->getMessage() );
98
+            throw ODataException::createInternalServerError($invalidArgumentException->getMessage());
99 99
         }
100 100
 
101 101
         
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
             $parent = $nullCheckExpTree;
519 519
             $key = null;        
520 520
             do {
521
-                $key = $parent->getResourceProperty()->getName() . '_' . $key;
521
+                $key = $parent->getResourceProperty()->getName().'_'.$key;
522 522
                 $parent = $parent->getParent();
523 523
             } while ($parent != null);
524 524
                         
Please login to merge, or discard this patch.
src/POData/UriProcessor/QueryProcessor/ExpressionParser/ExpressionToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
     {
86 86
         if ($this->Id != ExpressionTokenId::IDENTIFIER) {
87 87
             throw ODataException::createSyntaxError(
88
-                'Identifier expected at position ' . $this->Position
88
+                'Identifier expected at position '.$this->Position
89 89
             );
90 90
         }
91 91
 
Please login to merge, or discard this patch.
UriProcessor/QueryProcessor/ExpressionParser/Expressions/ExpressionType.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,92 +15,92 @@  discard block
 block discarded – undo
15 15
     /**
16 16
      * Arithmetic expression with 'add' operator
17 17
      */
18
-    const ADD                   = 1;
18
+    const ADD = 1;
19 19
 
20 20
     /**
21 21
      * Logical expression with 'and' operator
22 22
      */
23
-    const AND_LOGICAL           = 2;
23
+    const AND_LOGICAL = 2;
24 24
 
25 25
     /**
26 26
      * Funcation call expression 
27 27
      * e.g. substringof('Alfreds', CompanyName)
28 28
      */
29
-    const CALL                  = 3;
29
+    const CALL = 3;
30 30
 
31 31
     /**
32 32
      * Constant expression. e.g. In the expression
33 33
      * OrderID ne null and OrderID add 2 gt 5432
34 34
      * 2, null, 5432 are candicate for constant expression
35 35
      */
36
-    const CONSTANT              = 4;
36
+    const CONSTANT = 4;
37 37
 
38 38
     /**
39 39
      * Arithmetic expression with 'div' operator
40 40
      */
41
-    const DIVIDE                = 5;
41
+    const DIVIDE = 5;
42 42
 
43 43
     /**
44 44
      * Comparison expression with 'eq' operator
45 45
      */
46
-    const EQUAL                 = 6;
46
+    const EQUAL = 6;
47 47
 
48 48
     /**
49 49
      * Comparison expression with 'gt' operator
50 50
      */
51
-    const GREATERTHAN           = 7;
51
+    const GREATERTHAN = 7;
52 52
 
53 53
     /**
54 54
      * Comparison expression with 'ge' operator
55 55
      */
56
-    const GREATERTHAN_OR_EQUAL  = 8;
56
+    const GREATERTHAN_OR_EQUAL = 8;
57 57
 
58 58
     /**
59 59
      * Comparison expression with 'lt' operator
60 60
      */
61
-    const LESSTHAN              = 9;
61
+    const LESSTHAN = 9;
62 62
 
63 63
     /**
64 64
      * Comparison expression with 'le' operator
65 65
      */
66
-    const LESSTHAN_OR_EQUAL     = 10;
66
+    const LESSTHAN_OR_EQUAL = 10;
67 67
 
68 68
     /**
69 69
      * Arithmetic expression with 'mod' operator
70 70
      */
71
-    const MODULO                = 11;
71
+    const MODULO = 11;
72 72
 
73 73
     /**
74 74
      * Arithmetic expression with 'mul' operator
75 75
      */
76
-    const MULTIPLY              = 12;
76
+    const MULTIPLY = 12;
77 77
 
78 78
     /**
79 79
      * Unary expression with '-' operator
80 80
      */
81
-    const NEGATE                 = 13;
81
+    const NEGATE = 13;
82 82
 
83 83
     /**
84 84
      * Unary Logical expression with 'not' operator
85 85
      */
86
-    const NOT_LOGICAL           = 14;
86
+    const NOT_LOGICAL = 14;
87 87
 
88 88
     /**
89 89
      * Comparison expression with 'ne' operator
90 90
      */
91
-    const NOTEQUAL              = 15;
91
+    const NOTEQUAL = 15;
92 92
 
93 93
     /**
94 94
      * Logical expression with 'or' operator
95 95
      */
96
-    const OR_LOGICAL            = 16;
96
+    const OR_LOGICAL = 16;
97 97
 
98 98
     /**
99 99
      * Property expression. e.g. In the expression
100 100
      * OrderID add 2 gt 5432 
101 101
      * OrderID is candicate for PropertyAccessExpression
102 102
      */
103
-    const PROPERTYACCESS        = 17;
103
+    const PROPERTYACCESS = 17;
104 104
 
105 105
     /** 
106 106
      * Same as property expression but for nullabilty check
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      * 
112 112
      * Arithmetic expression with 'sub' operator
113 113
      */
114
-    const SUBTRACT              = 19;
114
+    const SUBTRACT = 19;
115 115
     
116 116
     
117 117
 }
118 118
\ No newline at end of file
Please login to merge, or discard this patch.
src/POData/UriProcessor/QueryProcessor/FunctionDescription.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function getPrototypeAsString()
71 71
     {
72
-        $str = $this->returnType->getFullTypeName() . ' ' . $this->name . '(';
72
+        $str = $this->returnType->getFullTypeName().' '.$this->name.'(';
73 73
 
74 74
 	    foreach ($this->argumentTypes as $argumentType) {
75
-            $str .= $argumentType->getFullTypeName() . ', ';
75
+            $str .= $argumentType->getFullTypeName().', ';
76 76
         }
77 77
 
78
-        return rtrim($str, ', ') . ')';
78
+        return rtrim($str, ', ').')';
79 79
     }
80 80
 
81 81
     /**      
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     {
470 470
         $string = null;
471 471
         foreach ($argExpressions as $argExpression) {
472
-            $string .= $argExpression->getType()->getFullTypeName() . ', ';
472
+            $string .= $argExpression->getType()->getFullTypeName().', ';
473 473
         }
474 474
 
475 475
         $string = rtrim($string, ', ');
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
     public static function validateUnaryOpArguments($expressionToken, $argExpression)
631 631
     {
632 632
         //Unary not
633
-        if (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT) == 0 ) {
633
+        if (strcmp($expressionToken->Text, ODataConstants::KEYWORD_NOT) == 0) {
634 634
             $function = self::findFunctionWithPromotion(
635 635
                 self::notOperationFunctions(), 
636 636
                 array($argExpression)
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
             
672 672
         }
673 673
 
674
-        $filterFunctions =  self::filterFunctionDescriptions();
674
+        $filterFunctions = self::filterFunctionDescriptions();
675 675
         return $filterFunctions[$expressionToken->Text];
676 676
     }
677 677
 
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
         if ($function == null) {
696 696
             $protoTypes = null;
697 697
             foreach ($functions as $function) {
698
-                $protoTypes .=  $function->getPrototypeAsString() . '; ';
698
+                $protoTypes .= $function->getPrototypeAsString().'; ';
699 699
             }
700 700
 
701 701
             throw ODataException::createSyntaxError(
Please login to merge, or discard this patch.
POData/UriProcessor/QueryProcessor/OrderByParser/InternalOrderByInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
                         // Also we can think about moving above urlencode to this 
177 177
                         // function
178 178
                         $value = $type->convertToOData($currentObject);
179
-                        $nextPageLink .= $value . ', ';
179
+                        $nextPageLink .= $value.', ';
180 180
                     }
181 181
                 } catch (\ReflectionException $reflectionException) {
182 182
                     throw ODataException::createInternalServerError(
Please login to merge, or discard this patch.
src/POData/UriProcessor/QueryProcessor/OrderByParser/OrderByLeafNode.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -111,25 +111,25 @@
 block discarded – undo
111 111
         
112 112
         foreach ($ancestors as $i => $anscestor) {
113 113
             if ($i == 0) {
114
-                $parameterNames = array (
115
-                    '$' . $anscestor . 'A', '$' . $anscestor . 'B'
114
+                $parameterNames = array(
115
+                    '$'.$anscestor.'A', '$'.$anscestor.'B'
116 116
                 );
117 117
                 $accessor1 = $parameterNames[0];
118 118
                 $accessor2 = $parameterNames[1];
119
-                $flag1 = '$flag1 = ' . 'is_null(' . $accessor1. ') || ';
120
-                $flag2 = '$flag2 = ' . 'is_null(' . $accessor2. ') || '; 
119
+                $flag1 = '$flag1 = '.'is_null('.$accessor1.') || ';
120
+                $flag2 = '$flag2 = '.'is_null('.$accessor2.') || '; 
121 121
             } else {
122
-                $accessor1 .= '->' . $anscestor;
123
-                $accessor2 .= '->' . $anscestor;
124
-                $flag1 .= 'is_null(' .$accessor1 . ')' . ' || ';
125
-                $flag2 .= 'is_null(' .$accessor2 . ')' . ' || ';
122
+                $accessor1 .= '->'.$anscestor;
123
+                $accessor2 .= '->'.$anscestor;
124
+                $flag1 .= 'is_null('.$accessor1.')'.' || ';
125
+                $flag2 .= 'is_null('.$accessor2.')'.' || ';
126 126
             }
127 127
         }
128 128
 
129
-        $accessor1 .= '->' . $this->propertyName;
130
-        $accessor2 .= '->' . $this->propertyName;
131
-        $flag1 .= 'is_null(' . $accessor1 . ')';
132
-        $flag2 .= 'is_null(' . $accessor2 . ')';
129
+        $accessor1 .= '->'.$this->propertyName;
130
+        $accessor2 .= '->'.$this->propertyName;
131
+        $flag1 .= 'is_null('.$accessor1.')';
132
+        $flag2 .= 'is_null('.$accessor2.')';
133 133
 
134 134
         $code = "$flag1; 
135 135
              $flag2; 
Please login to merge, or discard this patch.
src/POData/UriProcessor/QueryProcessor/OrderByParser/OrderByParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -444,7 +444,7 @@
 block discarded – undo
444 444
                             $lexer->validateToken(ExpressionTokenId::DOT);
445 445
                         }
446 446
 
447
-                        $orderByPathSegments[$i][] = '*' . $identifier;
447
+                        $orderByPathSegments[$i][] = '*'.$identifier;
448 448
                         $lexer->nextToken();
449 449
                         $tokenId = $lexer->getCurrentToken()->Id;
450 450
                         if ($tokenId != ExpressionTokenId::END) {
Please login to merge, or discard this patch.