Passed
Push — master ( a7cf01...71d572 )
by Béla
03:43
created
src/POData/UriProcessor/QueryProcessor/OrderByParser/OrderByParser.php 3 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private $_dummyObject;
67 67
 
68
-	private $_rootOrderByNode;
68
+    private $_rootOrderByNode;
69 69
     /**
70 70
      * Creates new instance of OrderByParser
71 71
      *
@@ -79,52 +79,52 @@  discard block
 block discarded – undo
79 79
     }
80 80
 
81 81
     private static function _mock($resourceType): object {
82
-		$instanceType = $resourceType->getInstanceType();
83
-		$reflection = new \ReflectionClass($instanceType->name);
84
-		$mock = $reflection->newInstanceWithoutConstructor();
85
-
86
-		foreach ($reflection->getProperties() as $property) {
87
-			$property->setAccessible(true);
88
-
89
-			$type = $property->getType();
90
-			if($resourceType instanceof ResourceProperty) {
91
-				$resourceType  = $resourceType->getResourceType();
92
-			}
93
-			$resourceProperty = $resourceType->resolveProperty($property->getName());
94
-			if(is_null($resourceProperty)) continue;
95
-
96
-			$resourcePropertyType = $resourceProperty->getResourceType();
97
-			$resourceKind = $resourcePropertyType->getResourceTypeKind();
98
-			if ($type && !$type->allowsNull()) {
99
-				if ($resourceKind === ResourceTypeKind::PRIMITIVE) {
100
-					switch ($type->getName()) {
101
-						case 'int':
102
-							$property->setValue($mock, 0);
103
-							break;
104
-						case 'string':
105
-							$property->setValue($mock, '');
106
-							break;
107
-						case 'bool':
108
-							$property->setValue($mock, false);
109
-							break;
110
-						case 'array':
111
-							// If the property is of type array, set it as an empty array
112
-							$property->setValue($mock, []);
113
-							break;
114
-						default:
115
-							break;
116
-					}
117
-				} else {
118
-					continue;
119
-				}
120
-			} else {
121
-				// If the property allows null, set it to null
122
-				$property->setValue($mock, null);
123
-			}
124
-		}
125
-
126
-		return $mock;
127
-	}
82
+        $instanceType = $resourceType->getInstanceType();
83
+        $reflection = new \ReflectionClass($instanceType->name);
84
+        $mock = $reflection->newInstanceWithoutConstructor();
85
+
86
+        foreach ($reflection->getProperties() as $property) {
87
+            $property->setAccessible(true);
88
+
89
+            $type = $property->getType();
90
+            if($resourceType instanceof ResourceProperty) {
91
+                $resourceType  = $resourceType->getResourceType();
92
+            }
93
+            $resourceProperty = $resourceType->resolveProperty($property->getName());
94
+            if(is_null($resourceProperty)) continue;
95
+
96
+            $resourcePropertyType = $resourceProperty->getResourceType();
97
+            $resourceKind = $resourcePropertyType->getResourceTypeKind();
98
+            if ($type && !$type->allowsNull()) {
99
+                if ($resourceKind === ResourceTypeKind::PRIMITIVE) {
100
+                    switch ($type->getName()) {
101
+                        case 'int':
102
+                            $property->setValue($mock, 0);
103
+                            break;
104
+                        case 'string':
105
+                            $property->setValue($mock, '');
106
+                            break;
107
+                        case 'bool':
108
+                            $property->setValue($mock, false);
109
+                            break;
110
+                        case 'array':
111
+                            // If the property is of type array, set it as an empty array
112
+                            $property->setValue($mock, []);
113
+                            break;
114
+                        default:
115
+                            break;
116
+                    }
117
+                } else {
118
+                    continue;
119
+                }
120
+            } else {
121
+                // If the property allows null, set it to null
122
+                $property->setValue($mock, null);
123
+            }
124
+        }
125
+
126
+        return $mock;
127
+    }
128 128
 
129 129
     /**
130 130
      * This function perform the following tasks with the help of internal helper
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,11 +87,11 @@
 block discarded – undo
87 87
 			$property->setAccessible(true);
88 88
 
89 89
 			$type = $property->getType();
90
-			if($resourceType instanceof ResourceProperty) {
91
-				$resourceType  = $resourceType->getResourceType();
90
+			if ($resourceType instanceof ResourceProperty) {
91
+				$resourceType = $resourceType->getResourceType();
92 92
 			}
93 93
 			$resourceProperty = $resourceType->resolveProperty($property->getName());
94
-			if(is_null($resourceProperty)) continue;
94
+			if (is_null($resourceProperty)) continue;
95 95
 
96 96
 			$resourcePropertyType = $resourceProperty->getResourceType();
97 97
 			$resourceKind = $resourcePropertyType->getResourceTypeKind();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,9 @@
 block discarded – undo
91 91
 				$resourceType  = $resourceType->getResourceType();
92 92
 			}
93 93
 			$resourceProperty = $resourceType->resolveProperty($property->getName());
94
-			if(is_null($resourceProperty)) continue;
94
+			if(is_null($resourceProperty)) {
95
+			    continue;
96
+			}
95 97
 
96 98
 			$resourcePropertyType = $resourceProperty->getResourceType();
97 99
 			$resourceKind = $resourcePropertyType->getResourceTypeKind();
Please login to merge, or discard this patch.