Completed
Push — master ( c7e8d1...934444 )
by Bálint
02:50
created
src/POData/UriProcessor/RequestDescription.php 1 patch
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -321,12 +321,10 @@  discard block
 block discarded – undo
321 321
                     }
322 322
                 }
323 323
             }
324
-        }
325
-        elseif ($dataType === MimeTypes::MIME_APPLICATION_JSON) {
324
+        } elseif ($dataType === MimeTypes::MIME_APPLICATION_JSON) {
326 325
             $data = json_decode($string, true);
327 326
             $this->_data = $data;
328
-        }
329
-        elseif (explode(';', $dataType)[0] === MimeTypes::MIME_MULTIPART_MIXED) {
327
+        } elseif (explode(';', $dataType)[0] === MimeTypes::MIME_MULTIPART_MIXED) {
330 328
             preg_match('/boundary=(.*)$/', $dataType, $matches);
331 329
             $boundary = $matches[1];
332 330
 
@@ -337,20 +335,22 @@  discard block
 block discarded – undo
337 335
             // loop data blocks
338 336
             foreach ($a_blocks as $id => $block)
339 337
             {
340
-                if (empty($block))
341
-                continue;
338
+                if (empty($block)) {
339
+                                continue;
340
+                }
342 341
 
343 342
                 $contentType = null;
344 343
                 $requestMethod = null;
345 344
                 $requestUrl = null;
346 345
 
347 346
                 foreach (explode("\n", $block) as $line) {
348
-                    if (empty($line)) continue;
347
+                    if (empty($line)) {
348
+                        continue;
349
+                    }
349 350
                     $m = array();
350 351
                     if (preg_match('/Content-Type:\s*(.*?)\s*$/', $line, $m)) {
351 352
                         $contentType = trim($m[1]);
352
-                    }
353
-                    else if (preg_match('/^(GET|PUT|POST|PATCH|DELETE)\s+(.*?)(\s+HTTP\/\d\.\d)?\s*$/', $line, $m)) {
353
+                    } else if (preg_match('/^(GET|PUT|POST|PATCH|DELETE)\s+(.*?)(\s+HTTP\/\d\.\d)?\s*$/', $line, $m)) {
354 354
                         $requestMethod = trim($m[1]);
355 355
                         $requestUrl = new Url(trim($m[2]), false);
356 356
                     }
Please login to merge, or discard this patch.
src/POData/UriProcessor/UriProcessor.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -143,21 +143,17 @@  discard block
 block discarded – undo
143 143
         $requestMethod = $operationContext->incomingRequest()->getMethod();
144 144
         if ($requestMethod == HTTPRequestMethod::GET) {
145 145
             $this->executeGet();
146
-        }
147
-        elseif ($requestMethod == HTTPRequestMethod::PUT) {
146
+        } elseif ($requestMethod == HTTPRequestMethod::PUT) {
148 147
             $this->executePut();
149
-        }
150
-        elseif ($requestMethod == HTTPRequestMethod::POST) {
148
+        } elseif ($requestMethod == HTTPRequestMethod::POST) {
151 149
             if ($this->request->getLastSegment()->getTargetKind() == TargetKind::BATCH()) {
152 150
                 $this->executeBatch();
153 151
             } else {
154 152
                 $this->executePost();
155 153
             }
156
-        }
157
-        elseif ($requestMethod == HTTPRequestMethod::DELETE) {
154
+        } elseif ($requestMethod == HTTPRequestMethod::DELETE) {
158 155
             $this->executeDelete();
159
-        }
160
-        else {
156
+        } else {
161 157
             throw ODataException::createNotImplementedError(Messages::unsupportedMethod($requestMethod));
162 158
         }
163 159
     }
@@ -622,7 +618,9 @@  discard block
 block discarded – undo
622 618
 		if (!empty($result)) {
623 619
 			$top  = $this->request->getTopCount();
624 620
 			$skip = $this->request->getSkipCount();
625
-			if(is_null($skip)) $skip = 0;
621
+			if(is_null($skip)) {
622
+			    $skip = 0;
623
+			}
626 624
 
627 625
 			$result = array_slice($result, $skip, $top);
628 626
 		}
Please login to merge, or discard this patch.