@@ -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 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | private $_dummyObject; |
65 | 65 | |
66 | - private $_rootOrderByNode; |
|
66 | + private $_rootOrderByNode; |
|
67 | 67 | /** |
68 | 68 | * Creates new instance of OrderByParser |
69 | 69 | * |
@@ -78,32 +78,32 @@ discard block |
||
78 | 78 | |
79 | 79 | private static function _mock($instanceType) |
80 | 80 | { |
81 | - $reflection = new \ReflectionClass($instanceType->name); |
|
82 | - $mock = $reflection->newInstanceWithoutConstructor(); |
|
83 | - |
|
84 | - foreach ($reflection->getProperties() as $property) { |
|
85 | - $property->setAccessible(true); |
|
86 | - |
|
87 | - // Check if the property has a non-nullable type and set a default value |
|
88 | - $type = $property->getType(); |
|
89 | - if ($type && !$type->allowsNull()) { |
|
90 | - // Determine a default value based on the type |
|
91 | - if ($type->getName() === 'int') { |
|
92 | - $property->setValue($mock, 0); // Default integer value |
|
93 | - } elseif ($type->getName() === 'string') { |
|
94 | - $property->setValue($mock, ''); // Default string value |
|
95 | - } elseif ($type->getName() === 'bool') { |
|
96 | - $property->setValue($mock, false); // Default boolean value |
|
97 | - } else { |
|
98 | - $property->setValue($mock, null); // Fallback to null for nullable types |
|
99 | - } |
|
100 | - } else { |
|
101 | - // If the property allows null, set it to null |
|
102 | - $property->setValue($mock, null); |
|
103 | - } |
|
104 | - } |
|
105 | - |
|
106 | - return $mock; |
|
81 | + $reflection = new \ReflectionClass($instanceType->name); |
|
82 | + $mock = $reflection->newInstanceWithoutConstructor(); |
|
83 | + |
|
84 | + foreach ($reflection->getProperties() as $property) { |
|
85 | + $property->setAccessible(true); |
|
86 | + |
|
87 | + // Check if the property has a non-nullable type and set a default value |
|
88 | + $type = $property->getType(); |
|
89 | + if ($type && !$type->allowsNull()) { |
|
90 | + // Determine a default value based on the type |
|
91 | + if ($type->getName() === 'int') { |
|
92 | + $property->setValue($mock, 0); // Default integer value |
|
93 | + } elseif ($type->getName() === 'string') { |
|
94 | + $property->setValue($mock, ''); // Default string value |
|
95 | + } elseif ($type->getName() === 'bool') { |
|
96 | + $property->setValue($mock, false); // Default boolean value |
|
97 | + } else { |
|
98 | + $property->setValue($mock, null); // Fallback to null for nullable types |
|
99 | + } |
|
100 | + } else { |
|
101 | + // If the property allows null, set it to null |
|
102 | + $property->setValue($mock, null); |
|
103 | + } |
|
104 | + } |
|
105 | + |
|
106 | + return $mock; |
|
107 | 107 | |
108 | 108 | } |
109 | 109 |
@@ -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; |