@@ -103,8 +103,8 @@ |
||
103 | 103 | Messages::orderByLeafNodeArgumentShouldBeNonEmptyArray() |
104 | 104 | ); |
105 | 105 | } |
106 | - $flag1 = ""; |
|
107 | - $flag2 = ""; |
|
106 | + $flag1 = ""; |
|
107 | + $flag2 = ""; |
|
108 | 108 | $parameterNames = null; |
109 | 109 | $accessor1 = null; |
110 | 110 | $accessor2 = null; |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | $this->_queryOptionsCount = null; |
63 | 63 | $this->_headers = null; |
64 | 64 | $this->getHeaders(); |
65 | - //Not sure about this |
|
66 | - $this->getQueryParameters(); |
|
65 | + //Not sure about this |
|
66 | + $this->getQueryParameters(); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | |
139 | 139 | $this->_rawUrl .= "://" . $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)]; |
140 | 140 | $this->_rawUrl .= $_SERVER[ODataConstants::HTTPREQUEST_URI]; |
141 | - //It looks like it is not working, for example if there is an $inlinecount then it will double the parameter |
|
142 | - //if (!empty($_SERVER[ODataConstants::HTTPREQUEST_QUERY_STRING])) { |
|
143 | - // $this->_rawUrl .= "?" . $_SERVER[ODataConstants::HTTPREQUEST_QUERY_STRING]; |
|
144 | - //} |
|
141 | + //It looks like it is not working, for example if there is an $inlinecount then it will double the parameter |
|
142 | + //if (!empty($_SERVER[ODataConstants::HTTPREQUEST_QUERY_STRING])) { |
|
143 | + // $this->_rawUrl .= "?" . $_SERVER[ODataConstants::HTTPREQUEST_QUERY_STRING]; |
|
144 | + //} |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $this->_rawUrl; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | if (is_null($this->_queryOptions)) { |
195 | 195 | $queryString = $this->getQueryString(); |
196 | 196 | $this->_queryOptions = array(); |
197 | - //example $filter=CustomerID gt \'ALFKI\' |
|
197 | + //example $filter=CustomerID gt \'ALFKI\' |
|
198 | 198 | foreach (explode('&', $queryString) as $queryOptionAsString) { |
199 | 199 | $queryOptionAsString = trim($queryOptionAsString); |
200 | 200 | if (!empty($queryOptionAsString)) { |
@@ -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; |
@@ -91,7 +91,9 @@ |
||
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(); |
@@ -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 |
@@ -81,7 +81,7 @@ discard block |
||
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 |
||
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(); |