Test Setup Failed
Pull Request — master (#136)
by Alex
04:09
created
src/POData/ObjectModel/CynicSerialiser.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $this->loadStackIfEmpty();
112 112
 
113 113
         $stackCount = count($this->lightStack);
114
-        $topOfStack = $this->lightStack[$stackCount-1];
114
+        $topOfStack = $this->lightStack[$stackCount - 1];
115 115
         $resourceType = $this->getService()->getProvidersWrapper()->resolveResourceType($topOfStack[0]);
116 116
         $rawProp = $resourceType->getAllProperties();
117 117
         $relProp = [];
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE'
158 158
             );
159 159
             $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed';
160
-            $propType = 'application/atom+xml;type='.$propTail;
160
+            $propType = 'application/atom+xml;type=' . $propTail;
161 161
             $propName = $prop->getName();
162 162
             $nuLink->title = $propName;
163 163
             $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName;
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      *
201 201
      * @return ODataFeed
202 202
      */
203
-    public function writeTopLevelElements(QueryResult &$entryObjects)
203
+    public function writeTopLevelElements(QueryResult & $entryObjects)
204 204
     {
205 205
         assert(is_array($entryObjects->results), '!is_array($entryObjects->results)');
206 206
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
      *
322 322
      * @return ODataPropertyContent
323 323
      */
324
-    public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType)
324
+    public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType)
325 325
     {
326 326
         $result = $complexValue->results;
327 327
 
@@ -349,14 +349,14 @@  discard block
 block discarded – undo
349 349
      *
350 350
      * @return ODataPropertyContent
351 351
      */
352
-    public function writeTopLevelBagObject(QueryResult &$bagValue, $propertyName, ResourceType &$resourceType)
352
+    public function writeTopLevelBagObject(QueryResult & $bagValue, $propertyName, ResourceType & $resourceType)
353 353
     {
354 354
         $result = $bagValue->results;
355 355
 
356 356
         $propertyContent = new ODataPropertyContent();
357 357
         $odataProperty = new ODataProperty();
358 358
         $odataProperty->name = $propertyName;
359
-        $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')';
359
+        $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')';
360 360
         $odataProperty->value = $this->writeBagValue($resourceType, $result);
361 361
 
362 362
         $propertyContent->properties[] = $odataProperty;
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
      *
372 372
      * @return ODataPropertyContent
373 373
      */
374
-    public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null)
374
+    public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null)
375 375
     {
376 376
         assert(null !== $resourceProperty, 'Resource property must not be null');
377 377
         $result = new ODataPropertyContent();
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
      * @param $result
454 454
      * @return ODataBagContent|null
455 455
      */
456
-    protected function writeBagValue(ResourceType &$resourceType, $result)
456
+    protected function writeBagValue(ResourceType & $resourceType, $result)
457 457
     {
458 458
         assert(null === $result || is_array($result), 'Bag parameter must be null or array');
459 459
         $typeKind = $resourceType->getResourceTypeKind();
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
      * @param string|null   $propertyName
487 487
      * @return ODataPropertyContent
488 488
      */
489
-    protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null)
489
+    protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null)
490 490
     {
491 491
         assert(is_object($result), 'Supplied $customObject must be an object');
492 492
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
         $skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject);
636 636
         assert(!is_null($skipToken), '!is_null($skipToken)');
637 637
         $token = (1 < $numSegments) ? '$skiptoken=' : '$skip=';
638
-        $skipToken = '?'.$queryParameterString.$token.$skipToken;
638
+        $skipToken = '?' . $queryParameterString . $token . $skipToken;
639 639
 
640 640
         return $skipToken;
641 641
     }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
      *
884 884
      * @return string
885 885
      */
886
-    private function primitiveToString(IType &$type, $primitiveValue)
886
+    private function primitiveToString(IType & $type, $primitiveValue)
887 887
     {
888 888
         if ($type instanceof Boolean) {
889 889
             $stringValue = (true === $primitiveValue) ? 'true' : 'false';
@@ -908,6 +908,6 @@  discard block
 block discarded – undo
908 908
         if (28 < $resourceKind) {
909 909
             return false;
910 910
         }
911
-        return 0 == ($resourceKind % 4);
911
+        return 0 == ($resourceKind%4);
912 912
     }
913 913
 }
Please login to merge, or discard this patch.