@@ -141,7 +141,7 @@ |
||
141 | 141 | $searchArraySize = count($searchArray) - 1; |
142 | 142 | $high = $searchArraySize; |
143 | 143 | do { |
144 | - $mid = intval($low + round(($high - $low) / 2)); |
|
144 | + $mid = intval($low + round(($high - $low)/2)); |
|
145 | 145 | $result = $comparer($keyObject, $searchArray[$mid]); |
146 | 146 | if ($result > 0) { |
147 | 147 | $low = $mid + 1; |
@@ -394,8 +394,7 @@ |
||
394 | 394 | private function executeGetResourceRelated(SegmentDescriptor $segment, $eagerList) |
395 | 395 | { |
396 | 396 | $projectedProperty = $segment->getProjectedProperty(); |
397 | - $projectedPropertyKind = null !== $projectedProperty ? $projectedProperty->getKind() : |
|
398 | - new ResourcePropertyKind(0); |
|
397 | + $projectedPropertyKind = null !== $projectedProperty ? $projectedProperty->getKind() : new ResourcePropertyKind(0); |
|
399 | 398 | $queryResult = null; |
400 | 399 | switch ($projectedPropertyKind) { |
401 | 400 | case ResourcePropertyKind::RESOURCE_REFERENCE(): |
@@ -207,7 +207,7 @@ |
||
207 | 207 | |
208 | 208 | case 'Edm.DateTime': |
209 | 209 | $dateTime = new DateTime($value, new DateTimeZone('UTC')); |
210 | - $formattedDateTime = $dateTime->format('U') * 1000; |
|
210 | + $formattedDateTime = $dateTime->format('U')*1000; |
|
211 | 211 | $this->writeCore('/Date(' . $formattedDateTime . ')/', /* quotes */ true); |
212 | 212 | break; |
213 | 213 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct(BaseService $service, $body) |
38 | 38 | { |
39 | 39 | $this->service = $service; |
40 | - $this->data = trim(str_replace("\r", '', $body)); // removes windows specific character |
|
40 | + $this->data = trim(str_replace("\r", '', $body)); // removes windows specific character |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function processSubRequest(&$newContext) |
94 | 94 | { |
95 | - $newHost = new ServiceHost($newContext); |
|
95 | + $newHost = new ServiceHost($newContext); |
|
96 | 96 | $oldHost = $this->getService()->getHost(); |
97 | 97 | $this->getService()->setHost($newHost); |
98 | 98 | $this->getService()->handleRequest(); |
@@ -116,8 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $response = ''; |
118 | 118 | $splitter = false === $this->changeSetBoundary ? |
119 | - '' : |
|
120 | - '--' . $this->changeSetBoundary . $ODataEOL; |
|
119 | + '' : '--' . $this->changeSetBoundary . $ODataEOL; |
|
121 | 120 | $raw = $this->getRawRequests(); |
122 | 121 | foreach ($raw as $contentID => &$workingObject) { |
123 | 122 | $headers = $workingObject->outgoingResponse()->getHeaders(); |
@@ -139,16 +138,14 @@ discard block |
||
139 | 138 | } |
140 | 139 | $response .= trim($splitter); |
141 | 140 | $response .= false === $this->changeSetBoundary ? |
142 | - $ODataEOL : |
|
143 | - '--' . $ODataEOL; |
|
141 | + $ODataEOL : '--' . $ODataEOL; |
|
144 | 142 | $response = 'Content-Length: ' . |
145 | 143 | strlen($response) . |
146 | 144 | $ODataEOL . |
147 | 145 | $ODataEOL . |
148 | 146 | $response; |
149 | 147 | $response = false === $this->changeSetBoundary ? |
150 | - $response : |
|
151 | - 'Content-Type: multipart/mixed; boundary=' . |
|
148 | + $response : 'Content-Type: multipart/mixed; boundary=' . |
|
152 | 149 | $this->changeSetBoundary . |
153 | 150 | $ODataEOL . |
154 | 151 | $response; |
@@ -158,7 +155,7 @@ discard block |
||
158 | 155 | public function handleData() |
159 | 156 | { |
160 | 157 | list($headerBlock, $contentBlock) = explode("\n\n", $this->getData(), 2); |
161 | - $headers = self::parse_headers ($headerBlock); |
|
158 | + $headers = self::parse_headers($headerBlock); |
|
162 | 159 | $this->changeSetBoundary = $headers['Content-Type']['boundary']; |
163 | 160 | $prefix = 'HTTP_'; |
164 | 161 | $matches = array_filter(explode('--' . $this->changeSetBoundary, $contentBlock)); |
@@ -175,8 +172,8 @@ discard block |
||
175 | 172 | $contentID = array_key_exists('Content-ID', $requestHeadersArray) ? $requestHeadersArray['Content-ID'] : $contentIDinit; |
176 | 173 | $inboundRequestHeaders = []; |
177 | 174 | $skip = true; |
178 | - foreach(explode("\n", $requestHeaders) as $headerLine){ |
|
179 | - if($skip){ |
|
175 | + foreach (explode("\n", $requestHeaders) as $headerLine) { |
|
176 | + if ($skip) { |
|
180 | 177 | $skip = false; |
181 | 178 | continue; |
182 | 179 | } |
@@ -218,16 +215,16 @@ discard block |
||
218 | 215 | $results = []; |
219 | 216 | foreach (array_filter(explode($splitter, trim($headers))) as $line) { |
220 | 217 | |
221 | - list ($key, $value) = strpos($line,$assignmentChar) !== false ? explode($assignmentChar, $line, 2) : ['default', $line]; |
|
218 | + list ($key, $value) = strpos($line, $assignmentChar) !== false ? explode($assignmentChar, $line, 2) : ['default', $line]; |
|
222 | 219 | $key = trim($key); |
223 | 220 | $value = trim($value); |
224 | - if(strpos($value, ';') !== false){ |
|
225 | - $value = self::parse_headers($value,';','='); |
|
221 | + if (strpos($value, ';') !== false) { |
|
222 | + $value = self::parse_headers($value, ';', '='); |
|
226 | 223 | } |
227 | 224 | if (isset($results[$key])) { |
228 | 225 | if (is_array($results[$key])) { |
229 | 226 | $results[$key][] = $value; |
230 | - }else { |
|
227 | + } else { |
|
231 | 228 | $results[$key] = [$results[$key], $value]; |
232 | 229 | } |
233 | 230 | } else { |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | $contentID = array_key_exists('Content-ID', $requestHeadersArray) ? $requestHeadersArray['Content-ID'] : $contentIDinit; |
176 | 176 | $inboundRequestHeaders = []; |
177 | 177 | $skip = true; |
178 | - foreach(explode("\n", $requestHeaders) as $headerLine){ |
|
179 | - if($skip){ |
|
178 | + foreach(explode("\n", $requestHeaders) as $headerLine) { |
|
179 | + if($skip) { |
|
180 | 180 | $skip = false; |
181 | 181 | continue; |
182 | 182 | } |
@@ -221,13 +221,13 @@ discard block |
||
221 | 221 | list ($key, $value) = strpos($line,$assignmentChar) !== false ? explode($assignmentChar, $line, 2) : ['default', $line]; |
222 | 222 | $key = trim($key); |
223 | 223 | $value = trim($value); |
224 | - if(strpos($value, ';') !== false){ |
|
224 | + if(strpos($value, ';') !== false) { |
|
225 | 225 | $value = self::parse_headers($value,';','='); |
226 | 226 | } |
227 | 227 | if (isset($results[$key])) { |
228 | 228 | if (is_array($results[$key])) { |
229 | 229 | $results[$key][] = $value; |
230 | - }else { |
|
230 | + } else { |
|
231 | 231 | $results[$key] = [$results[$key], $value]; |
232 | 232 | } |
233 | 233 | } else { |
@@ -268,9 +268,9 @@ |
||
268 | 268 | /** |
269 | 269 | * @param string $contentID |
270 | 270 | */ |
271 | - public function applyContentID(string $contentID,string $contentIdValue): void |
|
271 | + public function applyContentID(string $contentID, string $contentIdValue): void |
|
272 | 272 | { |
273 | - $this->rawInput = str_replace('$' . $contentID, $contentIdValue, $this->rawInput); |
|
273 | + $this->rawInput = str_replace('$' . $contentID, $contentIdValue, $this->rawInput); |
|
274 | 274 | $this->rawUrl = str_replace('$' . $contentID, $contentIdValue, $this->rawUrl); |
275 | 275 | } |
276 | 276 | } |