@@ -124,12 +124,12 @@ |
||
124 | 124 | { |
125 | 125 | if (is_null($this->_absoluteRequestUri)) { |
126 | 126 | $this->_absoluteRequestUriAsString = $this->_operationContext->incomingRequest()->getRawUrl(); |
127 | - $originalRequest = $this->_operationContext->incomingRequest(); |
|
127 | + $originalRequest = $this->_operationContext->incomingRequest(); |
|
128 | 128 | // Validate the uri first |
129 | 129 | try { |
130 | 130 | $this->_fullAbsoluteRequestUriAsString = $this->_absoluteRequestUriAsString; |
131 | 131 | $this->_fullAbsoluteRequestUri = new Url($this->_fullAbsoluteRequestUriAsString); |
132 | - $this->_fullAbsoluteRequestUri->setQueryOptions($originalRequest->getQueryParameters()); |
|
132 | + $this->_fullAbsoluteRequestUri->setQueryOptions($originalRequest->getQueryParameters()); |
|
133 | 133 | } catch (UrlFormatException $exception) { |
134 | 134 | throw ODataException::createBadRequestError($exception->getMessage()); |
135 | 135 | } |
@@ -68,19 +68,19 @@ |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - /** |
|
72 | - * Gets query options |
|
73 | - * |
|
74 | - * @return array |
|
75 | - */ |
|
71 | + /** |
|
72 | + * Gets query options |
|
73 | + * |
|
74 | + * @return array |
|
75 | + */ |
|
76 | 76 | public function getQueryOptions() |
77 | 77 | { |
78 | 78 | return $this->_queryOptions; |
79 | 79 | } |
80 | 80 | |
81 | - /** |
|
82 | - * Sets query options |
|
83 | - */ |
|
81 | + /** |
|
82 | + * Sets query options |
|
83 | + */ |
|
84 | 84 | public function setQueryOptions($_queryOptions) |
85 | 85 | { |
86 | 86 | $this->_queryOptions = $_queryOptions; |
@@ -65,7 +65,7 @@ discard block |
||
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 |
||
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 |