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