Test Failed
Pull Request — master (#81)
by Alex
02:55
created
src/Serialisers/IronicSerialiser.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $this->service = $service;
99 99
         $this->request = $request;
100 100
         $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString();
101
-        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/';
101
+        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/';
102 102
         $this->stack = new SegmentStack($request);
103 103
         $this->complexTypeInstanceCollection = [];
104 104
         $this->modelSerialiser = new ModelSerialiser();
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             $resourceType,
145 145
             $resourceSet->getName()
146 146
         );
147
-        $absoluteUri = rtrim($this->absoluteServiceUri, '/') . '/' . $relativeUri;
147
+        $absoluteUri = rtrim($this->absoluteServiceUri, '/').'/'.$relativeUri;
148 148
 
149 149
         list($mediaLink, $mediaLinks) = $this->writeMediaData($entryObject->results, $type, $relativeUri, $resourceType);
150 150
 
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
             $propType = 'application/atom+xml;type='.$propTail;
166 166
             $propName = $prop->getName();
167 167
             $nuLink->title = $propName;
168
-            $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName;
169
-            $nuLink->url = $relativeUri . '/' . $propName;
168
+            $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE.$propName;
169
+            $nuLink->url = $relativeUri.'/'.$propName;
170 170
             $nuLink->type = $propType;
171 171
 
172 172
             $navProp = new ODataNavigationPropertyInfo($prop, $this->shouldExpandSegment($propName));
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
      *
203 203
      * @return ODataFeed
204 204
      */
205
-    public function writeTopLevelElements(QueryResult &$entryObjects)
205
+    public function writeTopLevelElements(QueryResult & $entryObjects)
206 206
     {
207 207
         assert(is_array($entryObjects->results), '!is_array($entryObjects->results)');
208 208
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $resourceSet = $this->getRequest()->getTargetResourceSetWrapper()->getResourceSet();
240 240
         $requestTop = $this->getRequest()->getTopOptionCount();
241 241
         $pageSize = $this->getService()->getConfiguration()->getEntitySetPageSize($resourceSet);
242
-        $requestTop = (null == $requestTop) ? $pageSize + 1 : $requestTop;
242
+        $requestTop = (null == $requestTop) ? $pageSize+1 : $requestTop;
243 243
 
244 244
         if (true === $entryObjects->hasMore && $requestTop > $pageSize) {
245 245
             $stackSegment = $setName;
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             $segment = $this->getNextLinkUri($lastObject, $absoluteUri);
248 248
             $nextLink = new ODataLink();
249 249
             $nextLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING;
250
-            $nextLink->url = rtrim($this->absoluteServiceUri, '/') . '/' . $stackSegment . $segment;
250
+            $nextLink->url = rtrim($this->absoluteServiceUri, '/').'/'.$stackSegment.$segment;
251 251
             $odata->nextPageLink = $nextLink;
252 252
         }
253 253
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
                 $this->getCurrentResourceSetWrapper()->getName()
273 273
             );
274 274
 
275
-            $url->url = rtrim($this->absoluteServiceUri, '/') . '/' . $relativeUri;
275
+            $url->url = rtrim($this->absoluteServiceUri, '/').'/'.$relativeUri;
276 276
         }
277 277
 
278 278
         return $url;
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                 $segment = $this->getNextLinkUri($lastObject, $this->getRequest()->getRequestUrl()->getUrlAsString());
303 303
                 $nextLink = new ODataLink();
304 304
                 $nextLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING;
305
-                $nextLink->url = rtrim($this->absoluteServiceUri, '/') . '/' . $stackSegment . $segment;
305
+                $nextLink->url = rtrim($this->absoluteServiceUri, '/').'/'.$stackSegment.$segment;
306 306
                 $urls->nextPageLink = $nextLink;
307 307
             }
308 308
         }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
      *
327 327
      * @return ODataPropertyContent
328 328
      */
329
-    public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType)
329
+    public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType)
330 330
     {
331 331
         $result = $complexValue->results;
332 332
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      *                                    bag object
357 357
      * @return ODataPropertyContent
358 358
      */
359
-    public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType)
359
+    public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType)
360 360
     {
361 361
         $result = $BagValue->results;
362 362
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
      *                                            to be written
382 382
      * @return ODataPropertyContent
383 383
      */
384
-    public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null)
384
+    public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null)
385 385
     {
386 386
         assert(null != $resourceProperty, "Resource property must not be null");
387 387
         $propertyContent = new ODataPropertyContent();
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
         $typeName = $resourceType->getName();
450 450
         $keyProperties = $resourceType->getKeyProperties();
451 451
         assert(count($keyProperties) != 0, 'count($keyProperties) == 0');
452
-        $keyString = $containerName . '(';
452
+        $keyString = $containerName.'(';
453 453
         $comma = null;
454 454
         foreach ($keyProperties as $keyName => $resourceProperty) {
455 455
             $keyType = $resourceProperty->getInstanceType();
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
             }
464 464
 
465 465
             $keyValue = $keyType->convertToOData($keyValue);
466
-            $keyString .= $comma . $keyName . '=' . $keyValue;
466
+            $keyString .= $comma.$keyName.'='.$keyValue;
467 467
             $comma = ',';
468 468
         }
469 469
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
         $mediaLink = null;
489 489
         if ($resourceType->isMediaLinkEntry()) {
490 490
             $eTag = $streamProviderWrapper->getStreamETag2($entryObject, null, $context);
491
-            $mediaLink = new ODataMediaLink($type, '/$value', $relativeUri . '/$value', '*/*', $eTag);
491
+            $mediaLink = new ODataMediaLink($type, '/$value', $relativeUri.'/$value', '*/*', $eTag);
492 492
         }
493 493
         $mediaLinks = [];
494 494
         if ($resourceType->hasNamedStream()) {
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
         $segmentWrappers = $this->getStack()->getSegmentWrappers();
630 630
         $count = count($segmentWrappers);
631 631
 
632
-        return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count - 1];
632
+        return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1];
633 633
     }
634 634
 
635 635
     /**
@@ -679,22 +679,22 @@  discard block
 block discarded – undo
679 679
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
680 680
             if (!is_null($value)) {
681 681
                 if (!is_null($queryParameterString)) {
682
-                    $queryParameterString = $queryParameterString . '&';
682
+                    $queryParameterString = $queryParameterString.'&';
683 683
                 }
684 684
 
685
-                $queryParameterString .= $queryOption . '=' . $value;
685
+                $queryParameterString .= $queryOption.'='.$value;
686 686
             }
687 687
         }
688 688
 
689 689
         $topCountValue = $this->getRequest()->getTopOptionCount();
690 690
         if (!is_null($topCountValue)) {
691
-            $remainingCount = $topCountValue - $this->getRequest()->getTopCount();
691
+            $remainingCount = $topCountValue-$this->getRequest()->getTopCount();
692 692
             if (0 < $remainingCount) {
693 693
                 if (!is_null($queryParameterString)) {
694 694
                     $queryParameterString .= '&';
695 695
                 }
696 696
 
697
-                $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP . '=' . $remainingCount;
697
+                $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP.'='.$remainingCount;
698 698
             }
699 699
         }
700 700
 
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
      *
724 724
      * @return string
725 725
      */
726
-    private function primitiveToString(IType &$type, $primitiveValue)
726
+    private function primitiveToString(IType & $type, $primitiveValue)
727 727
     {
728 728
         if ($type instanceof Boolean) {
729 729
             $stringValue = (true === $primitiveValue) ? 'true' : 'false';
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
                 $nuLink->expandedResult->selfLink->title = $propName;
796 796
                 $nuLink->expandedResult->selfLink->url = $nuLink->url;
797 797
                 $nuLink->expandedResult->title = $propName;
798
-                $nuLink->expandedResult->id = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->url;
798
+                $nuLink->expandedResult->id = rtrim($this->absoluteServiceUri, '/').'/'.$nuLink->url;
799 799
             }
800 800
         }
801 801
     }
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
     {
810 810
         $this->service = $service;
811 811
         $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString();
812
-        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/';
812
+        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/';
813 813
     }
814 814
 
815 815
     /**
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
      * @param $result
818 818
      * @return ODataBagContent
819 819
      */
820
-    protected function writeBagValue(ResourceType &$resourceType, $result)
820
+    protected function writeBagValue(ResourceType & $resourceType, $result)
821 821
     {
822 822
         assert(null == $result || is_array($result), 'Bag parameter must be null or array');
823 823
         $typeKind = $resourceType->getResourceTypeKind();
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
      * @param $result
849 849
      * @return ODataPropertyContent
850 850
      */
851
-    protected function writeComplexValue(ResourceType &$resourceType, $result)
851
+    protected function writeComplexValue(ResourceType & $resourceType, $result)
852 852
     {
853 853
         $internalContent = new ODataPropertyContent();
854 854
         $resourceProperties = $resourceType->getAllProperties();
Please login to merge, or discard this patch.