Test Failed
Pull Request — master (#99)
by Alex
03:38
created
src/Serialisers/IronicSerialiser.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             }
175 175
             // despite all set up, checking, etc, if we haven't picked a concrete resource type,
176 176
             // wheels have fallen off, so blow up
177
-            assert(!$resourceType->isAbstract(), 'Concrete resource type not selected for payload '.$payloadClass);
177
+            assert(!$resourceType->isAbstract(), 'Concrete resource type not selected for payload ' . $payloadClass);
178 178
         }
179 179
 
180 180
         // make sure we're barking up right tree
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         $targClass = $resourceType->getInstanceType()->getName();
183 183
         assert(
184 184
             $entryObject->results instanceof $targClass,
185
-            'Object being serialised not instance of expected class, '.$targClass. ', is actually '.$payloadClass
185
+            'Object being serialised not instance of expected class, ' . $targClass . ', is actually ' . $payloadClass
186 186
         );
187 187
 
188 188
         $rawProp = $resourceType->getAllProperties();
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE'
230 230
             );
231 231
             $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed';
232
-            $propType = 'application/atom+xml;type='.$propTail;
232
+            $propType = 'application/atom+xml;type=' . $propTail;
233 233
             $propName = $prop->getName();
234 234
             $nuLink->title = $propName;
235 235
             $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      *
281 281
      * @return ODataFeed
282 282
      */
283
-    public function writeTopLevelElements(QueryResult &$entryObjects)
283
+    public function writeTopLevelElements(QueryResult & $entryObjects)
284 284
     {
285 285
         $res = $entryObjects->results;
286 286
         assert(is_array($res) || $res instanceof Collection, '!is_array($entryObjects->results)');
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         $resourceSet = $this->getRequest()->getTargetResourceSetWrapper()->getResourceSet();
322 322
         $requestTop = $this->getRequest()->getTopOptionCount();
323 323
         $pageSize = $this->getService()->getConfiguration()->getEntitySetPageSize($resourceSet);
324
-        $requestTop = (null === $requestTop) ? $pageSize + 1 : $requestTop;
324
+        $requestTop = (null === $requestTop) ? $pageSize+1 : $requestTop;
325 325
 
326 326
         if (true === $entryObjects->hasMore && $requestTop > $pageSize) {
327 327
             $stackSegment = $setName;
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      *
405 405
      * @return ODataPropertyContent
406 406
      */
407
-    public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType)
407
+    public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType)
408 408
     {
409 409
         $result = $complexValue->results;
410 410
 
@@ -433,14 +433,14 @@  discard block
 block discarded – undo
433 433
      *                                    bag object
434 434
      * @return ODataPropertyContent
435 435
      */
436
-    public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType)
436
+    public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType)
437 437
     {
438 438
         $result = $BagValue->results;
439 439
 
440 440
         $propertyContent = new ODataPropertyContent();
441 441
         $odataProperty = new ODataProperty();
442 442
         $odataProperty->name = $propertyName;
443
-        $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')';
443
+        $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')';
444 444
         $odataProperty->value = $this->writeBagValue($resourceType, $result);
445 445
 
446 446
         $propertyContent->properties[$propertyName] = $odataProperty;
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      *                                            primitive property to be written
457 457
      * @return ODataPropertyContent
458 458
      */
459
-    public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null)
459
+    public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null)
460 460
     {
461 461
         assert(null != $resourceProperty, 'Resource property must not be null');
462 462
         $propertyContent = new ODataPropertyContent();
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
         $segmentWrappers = $this->getStack()->getSegmentWrappers();
716 716
         $count = count($segmentWrappers);
717 717
 
718
-        return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count - 1];
718
+        return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1];
719 719
     }
720 720
 
721 721
     /**
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
         $skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject);
741 741
         assert(!is_null($skipToken), '!is_null($skipToken)');
742 742
         $token = (1 < $numSegments) ? '$skiptoken=' : '$skip=';
743
-        $skipToken = '?'.$queryParameterString.$token.$skipToken;
743
+        $skipToken = '?' . $queryParameterString . $token . $skipToken;
744 744
 
745 745
         return $skipToken;
746 746
     }
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 
775 775
         $topCountValue = $this->getRequest()->getTopOptionCount();
776 776
         if (!is_null($topCountValue)) {
777
-            $remainingCount = $topCountValue - $this->getRequest()->getTopCount();
777
+            $remainingCount = $topCountValue-$this->getRequest()->getTopCount();
778 778
             if (0 < $remainingCount) {
779 779
                 if (!is_null($queryParameterString)) {
780 780
                     $queryParameterString .= '&';
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
      *
810 810
      * @return string
811 811
      */
812
-    private function primitiveToString(IType &$type, $primitiveValue)
812
+    private function primitiveToString(IType & $type, $primitiveValue)
813 813
     {
814 814
         if ($type instanceof Boolean) {
815 815
             $stringValue = (true === $primitiveValue) ? 'true' : 'false';
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
      * @param $result
910 910
      * @return ODataBagContent|null
911 911
      */
912
-    protected function writeBagValue(ResourceType &$resourceType, $result)
912
+    protected function writeBagValue(ResourceType & $resourceType, $result)
913 913
     {
914 914
         assert(null == $result || is_array($result), 'Bag parameter must be null or array');
915 915
         $typeKind = $resourceType->getResourceTypeKind();
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
      * @param string|null   $propertyName
943 943
      * @return ODataPropertyContent
944 944
      */
945
-    protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null)
945
+    protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null)
946 946
     {
947 947
         assert(is_object($result), 'Supplied $customObject must be an object');
948 948
 
Please login to merge, or discard this patch.