Test Setup Failed
Pull Request — master (#136)
by Alex
04:08
created
src/POData/ObjectModel/CynicSerialiser.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -565,10 +565,10 @@
 block discarded – undo
565 565
     {
566 566
         $queryParameterString = null;
567 567
         foreach ([ODataConstants::HTTPQUERY_STRING_FILTER,
568
-                     ODataConstants::HTTPQUERY_STRING_EXPAND,
569
-                     ODataConstants::HTTPQUERY_STRING_ORDERBY,
570
-                     ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
571
-                     ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
568
+                        ODataConstants::HTTPQUERY_STRING_EXPAND,
569
+                        ODataConstants::HTTPQUERY_STRING_ORDERBY,
570
+                        ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
571
+                        ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
572 572
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
573 573
             if (null !== $value) {
574 574
                 if (null !== $queryParameterString) {
Please login to merge, or discard this 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.
src/POData/ObjectModel/ObjectModelSerializer.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      *
72 72
      * @return ODataFeed
73 73
      */
74
-    public function writeTopLevelElements(QueryResult &$entryObjects)
74
+    public function writeTopLevelElements(QueryResult & $entryObjects)
75 75
     {
76 76
         assert(is_array($entryObjects->results), '!is_array($entryObjects->results)');
77 77
         $requestTargetSource = $this->getRequest()->getTargetSource();
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
      * @return ODataPropertyContent
188 188
      */
189 189
     public function writeTopLevelComplexObject(
190
-        QueryResult &$complexValue,
190
+        QueryResult & $complexValue,
191 191
         $propertyName,
192
-        ResourceType &$resourceType
192
+        ResourceType & $resourceType
193 193
     ) {
194 194
         $propertyContent = new ODataPropertyContent();
195 195
         $this->writeComplexValue(
@@ -212,9 +212,9 @@  discard block
 block discarded – undo
212 212
      * @return ODataPropertyContent
213 213
      */
214 214
     public function writeTopLevelBagObject(
215
-        QueryResult &$bagValue,
215
+        QueryResult & $bagValue,
216 216
         $propertyName,
217
-        ResourceType &$resourceType
217
+        ResourceType & $resourceType
218 218
     ) {
219 219
         $propertyContent = new ODataPropertyContent();
220 220
         $this->writeBagValue(
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
      * @return ODataPropertyContent
238 238
      */
239 239
     public function writeTopLevelPrimitive(
240
-        QueryResult &$primitiveValue,
241
-        ResourceProperty &$resourceProperty = null
240
+        QueryResult & $primitiveValue,
241
+        ResourceProperty & $resourceProperty = null
242 242
     ) {
243 243
         assert(null != $resourceProperty, 'Resource property must not be null');
244 244
         $propertyContent = new ODataPropertyContent();
@@ -323,11 +323,11 @@  discard block
 block discarded – undo
323 323
      */
324 324
     private function writeFeedElements(
325 325
         &$entryObjects,
326
-        ResourceType &$resourceType,
326
+        ResourceType & $resourceType,
327 327
         $title,
328 328
         $absoluteUri,
329 329
         $relativeUri,
330
-        ODataFeed &$feed,
330
+        ODataFeed & $feed,
331 331
         $needLink = false
332 332
     ) {
333 333
         assert(is_array($entryObjects), '!_writeFeedElements::is_array($entryObjects)');
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
      */
387 387
     private function writeObjectProperties(
388 388
         $customObject,
389
-        ResourceType &$resourceType,
389
+        ResourceType & $resourceType,
390 390
         $absoluteUri,
391 391
         $relativeUri,
392 392
         &$odataEntry,
393
-        ODataPropertyContent &$odataPropertyContent
393
+        ODataPropertyContent & $odataPropertyContent
394 394
     ) {
395 395
         $resourceTypeKind = $resourceType->getResourceTypeKind();
396 396
         if ((null === $absoluteUri) == (ResourceTypeKind::ENTITY() == $resourceTypeKind)) {
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
      */
515 515
     private function writePrimitiveValue(
516 516
         &$primitiveValue,
517
-        ODataProperty &$odataProperty,
518
-        ResourceProperty &$resourceProperty
517
+        ODataProperty & $odataProperty,
518
+        ResourceProperty & $resourceProperty
519 519
     ) {
520 520
         if (is_object($primitiveValue)) {
521 521
             //TODO ERROR: The property 'PropertyName'
@@ -551,9 +551,9 @@  discard block
 block discarded – undo
551 551
     private function writeComplexValue(
552 552
         &$complexValue,
553 553
         $propertyName,
554
-        ResourceType &$resourceType,
554
+        ResourceType & $resourceType,
555 555
         $relativeUri,
556
-        ODataPropertyContent &$odataPropertyContent
556
+        ODataPropertyContent & $odataPropertyContent
557 557
     ) {
558 558
         $odataProperty = new ODataProperty();
559 559
         $odataProperty->name = $propertyName;
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
     private function writeBagValue(
595 595
         &$bagValue,
596 596
         $propertyName,
597
-        ResourceType &$resourceType,
597
+        ResourceType & $resourceType,
598 598
         $relativeUri,
599
-        ODataPropertyContent &$odataPropertyContent
599
+        ODataPropertyContent & $odataPropertyContent
600 600
     ) {
601 601
         assert(null == $bagValue || is_array($bagValue), 'Bag parameter must be null or array');
602 602
         $bagItemResourceTypeKind = $resourceType->getResourceTypeKind();
@@ -654,10 +654,10 @@  discard block
 block discarded – undo
654 654
      */
655 655
     private function writeMediaResourceMetadata(
656 656
         $entryObject,
657
-        ResourceType &$resourceType,
657
+        ResourceType & $resourceType,
658 658
         $title,
659 659
         $relativeUri,
660
-        ODataEntry &$odataEntry
660
+        ODataEntry & $odataEntry
661 661
     ) {
662 662
         $streamProviderWrapper = $this->getService()->getStreamProviderWrapper();
663 663
         assert(null != $streamProviderWrapper, 'Retrieved stream provider must not be null');
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
      * @return string
731 731
      */
732 732
     private function primitiveToString(
733
-        ResourceType &$primitiveResourceType,
733
+        ResourceType & $primitiveResourceType,
734 734
         $primitiveValue
735 735
     ) {
736 736
         $type = $primitiveResourceType->getInstanceType();
@@ -770,9 +770,9 @@  discard block
 block discarded – undo
770 770
     private function complexObjectToContent(
771 771
         &$complexValue,
772 772
         $propertyName,
773
-        ResourceType &$resourceType,
773
+        ResourceType & $resourceType,
774 774
         $relativeUri,
775
-        ODataPropertyContent &$odataPropertyContent
775
+        ODataPropertyContent & $odataPropertyContent
776 776
     ) {
777 777
         $count = count($this->complexTypeInstanceCollection);
778 778
         for ($i = 0; $i < $count; ++$i) {
@@ -815,9 +815,9 @@  discard block
 block discarded – undo
815 815
      */
816 816
     private function writeObjectPropertiesUnexpanded(
817 817
         $customObject,
818
-        ResourceType &$resourceType,
818
+        ResourceType & $resourceType,
819 819
         $relativeUri,
820
-        ODataPropertyContent &$odataPropertyContent,
820
+        ODataPropertyContent & $odataPropertyContent,
821 821
         ResourceTypeKind $resourceTypeKind,
822 822
         $navigationProperties
823 823
     ) {
@@ -935,9 +935,9 @@  discard block
 block discarded – undo
935 935
      */
936 936
     private function writeObjectPropertiesExpanded(
937 937
         $customObject,
938
-        ResourceType &$resourceType,
938
+        ResourceType & $resourceType,
939 939
         $relativeUri,
940
-        ODataPropertyContent &$odataPropertyContent,
940
+        ODataPropertyContent & $odataPropertyContent,
941 941
         $projectionNodes,
942 942
         $navigationProperties
943 943
     ) {
Please login to merge, or discard this patch.