@@ -50,7 +50,7 @@ |
||
50 | 50 | * |
51 | 51 | * @return bool true if the segment was push, false otherwise |
52 | 52 | */ |
53 | - public function pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
53 | + public function pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper) |
|
54 | 54 | { |
55 | 55 | if (!is_string($segmentName)) { |
56 | 56 | throw new InvalidOperationException('segmentName must be a string'); |
@@ -132,7 +132,7 @@ |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | $this->rawUrl .= '://' . |
135 | - $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)]; |
|
135 | + $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)]; |
|
136 | 136 | $this->rawUrl .= utf8_decode(urldecode($_SERVER[ODataConstants::HTTPREQUEST_URI])); |
137 | 137 | } |
138 | 138 |
@@ -157,8 +157,8 @@ |
||
157 | 157 | |
158 | 158 | case 'Edm.DateTime': |
159 | 159 | $dateTime = new Carbon($value, new \DateTimeZone('UTC')); |
160 | - $formattedDateTime = $dateTime->format('U') * 1000; |
|
161 | - $this->writeCore('/Date('.$formattedDateTime.')/', /* quotes */ true); |
|
160 | + $formattedDateTime = $dateTime->format('U')*1000; |
|
161 | + $this->writeCore('/Date(' . $formattedDateTime . ')/', /* quotes */ true); |
|
162 | 162 | break; |
163 | 163 | |
164 | 164 | case 'Edm.String': |
@@ -469,7 +469,7 @@ |
||
469 | 469 | ODataConstants::HTTPQUERY_STRING_ORDERBY, |
470 | 470 | ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
471 | 471 | ODataConstants::HTTPQUERY_STRING_SELECT |
472 | - ] as $queryOption) { |
|
472 | + ] as $queryOption) { |
|
473 | 473 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
474 | 474 | if (!is_null($value)) { |
475 | 475 | if (!is_null($queryParameterString)) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @return ODataFeed |
32 | 32 | */ |
33 | - public function writeTopLevelElements(QueryResult &$entryObjects); |
|
33 | + public function writeTopLevelElements(QueryResult & $entryObjects); |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Write top level url element. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return ODataPropertyContent |
62 | 62 | */ |
63 | - public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType); |
|
63 | + public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType); |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Write top level bag resource. |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * |
72 | 72 | * @return ODataPropertyContent |
73 | 73 | */ |
74 | - public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType); |
|
74 | + public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType); |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Write top level primitive value. |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return ODataPropertyContent |
83 | 83 | */ |
84 | - public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null); |
|
84 | + public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Gets reference to the request submitted by client. |
@@ -411,7 +411,7 @@ |
||
411 | 411 | $this->getRequest()->getFilterInfo(), |
412 | 412 | null, // $orderby |
413 | 413 | null, // $top |
414 | - null, // $skip |
|
414 | + null, // $skip |
|
415 | 415 | $skipToken |
416 | 416 | ); |
417 | 417 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function getLeft() |
40 | 40 | { |
41 | - return isset($this->left) ? $this->left: null; |
|
41 | + return isset($this->left) ? $this->left : null; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -430,7 +430,8 @@ |
||
430 | 430 | $resourceTypeKind, |
431 | 431 | $navigationProperties |
432 | 432 | ); |
433 | - } else { //This is the code path to handle projected properties of Entry |
|
433 | + } else { |
|
434 | +//This is the code path to handle projected properties of Entry |
|
434 | 435 | list($odataPropertyContent, $navigationProperties) = $this->writeObjectPropertiesExpanded( |
435 | 436 | $customObject, |
436 | 437 | $resourceType, |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * |
76 | 76 | * @return ODataFeed |
77 | 77 | */ |
78 | - public function writeTopLevelElements(QueryResult &$entryObjects) |
|
78 | + public function writeTopLevelElements(QueryResult & $entryObjects) |
|
79 | 79 | { |
80 | 80 | assert(is_array($entryObjects->results), '!is_array($entryObjects->results)'); |
81 | 81 | $requestTargetSource = $this->getRequest()->getTargetSource(); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @return ODataPropertyContent |
192 | 192 | */ |
193 | 193 | public function writeTopLevelComplexObject( |
194 | - QueryResult &$complexValue, |
|
194 | + QueryResult & $complexValue, |
|
195 | 195 | $propertyName, |
196 | 196 | ResourceType & $resourceType |
197 | 197 | ) { |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | * @return ODataPropertyContent |
218 | 218 | */ |
219 | 219 | public function writeTopLevelBagObject( |
220 | - QueryResult &$BagValue, |
|
220 | + QueryResult & $BagValue, |
|
221 | 221 | $propertyName, |
222 | - ResourceType &$resourceType |
|
222 | + ResourceType & $resourceType |
|
223 | 223 | ) { |
224 | 224 | $propertyContent = new ODataPropertyContent(); |
225 | 225 | $this->writeBagValue( |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | * @return ODataPropertyContent |
243 | 243 | */ |
244 | 244 | public function writeTopLevelPrimitive( |
245 | - QueryResult &$primitiveValue, |
|
246 | - ResourceProperty &$resourceProperty = null |
|
245 | + QueryResult & $primitiveValue, |
|
246 | + ResourceProperty & $resourceProperty = null |
|
247 | 247 | ) { |
248 | 248 | assert(null != $resourceProperty, 'Resource property must not be null'); |
249 | 249 | $propertyContent = new ODataPropertyContent(); |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | */ |
332 | 332 | private function writeFeedElements( |
333 | 333 | &$entryObjects, |
334 | - ResourceType &$resourceType, |
|
334 | + ResourceType & $resourceType, |
|
335 | 335 | $title, |
336 | 336 | $absoluteUri, |
337 | 337 | $relativeUri, |
338 | - ODataFeed &$feed, |
|
338 | + ODataFeed & $feed, |
|
339 | 339 | $needLink = false |
340 | 340 | ) { |
341 | 341 | assert(is_array($entryObjects), '!_writeFeedElements::is_array($entryObjects)'); |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | */ |
393 | 393 | private function writeObjectProperties( |
394 | 394 | $customObject, |
395 | - ResourceType &$resourceType, |
|
395 | + ResourceType & $resourceType, |
|
396 | 396 | $absoluteUri, |
397 | 397 | $relativeUri, |
398 | 398 | &$odataEntry, |
399 | - ODataPropertyContent &$odataPropertyContent |
|
399 | + ODataPropertyContent & $odataPropertyContent |
|
400 | 400 | ) { |
401 | 401 | $resourceTypeKind = $resourceType->getResourceTypeKind(); |
402 | 402 | if (is_null($absoluteUri) == (ResourceTypeKind::ENTITY == $resourceTypeKind) |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | */ |
520 | 520 | private function writePrimitiveValue( |
521 | 521 | &$primitiveValue, |
522 | - ODataProperty &$odataProperty, |
|
523 | - ResourceProperty &$resourceProperty |
|
522 | + ODataProperty & $odataProperty, |
|
523 | + ResourceProperty & $resourceProperty |
|
524 | 524 | ) { |
525 | 525 | if (is_object($primitiveValue)) { |
526 | 526 | //TODO ERROR: The property 'PropertyName' |
@@ -554,9 +554,9 @@ discard block |
||
554 | 554 | private function writeComplexValue( |
555 | 555 | &$complexValue, |
556 | 556 | $propertyName, |
557 | - ResourceType &$resourceType, |
|
557 | + ResourceType & $resourceType, |
|
558 | 558 | $relativeUri, |
559 | - ODataPropertyContent &$odataPropertyContent |
|
559 | + ODataPropertyContent & $odataPropertyContent |
|
560 | 560 | ) { |
561 | 561 | $odataProperty = new ODataProperty(); |
562 | 562 | $odataProperty->name = $propertyName; |
@@ -595,9 +595,9 @@ discard block |
||
595 | 595 | private function writeBagValue( |
596 | 596 | &$BagValue, |
597 | 597 | $propertyName, |
598 | - ResourceType &$resourceType, |
|
598 | + ResourceType & $resourceType, |
|
599 | 599 | $relativeUri, |
600 | - ODataPropertyContent &$odataPropertyContent |
|
600 | + ODataPropertyContent & $odataPropertyContent |
|
601 | 601 | ) { |
602 | 602 | assert(null == $BagValue || is_array($BagValue), 'Bag parameter must be null or array'); |
603 | 603 | $bagItemResourceTypeKind = $resourceType->getResourceTypeKind(); |
@@ -655,10 +655,10 @@ discard block |
||
655 | 655 | */ |
656 | 656 | private function writeMediaResourceMetadata( |
657 | 657 | $entryObject, |
658 | - ResourceType &$resourceType, |
|
658 | + ResourceType & $resourceType, |
|
659 | 659 | $title, |
660 | 660 | $relativeUri, |
661 | - ODataEntry &$odataEntry |
|
661 | + ODataEntry & $odataEntry |
|
662 | 662 | ) { |
663 | 663 | $streamProviderWrapper = $this->getService()->getStreamProviderWrapper(); |
664 | 664 | assert(null != $streamProviderWrapper, 'Retrieved stream provider must not be null'); |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | * @return string |
732 | 732 | */ |
733 | 733 | private function primitiveToString( |
734 | - ResourceType &$primitiveResourceType, |
|
734 | + ResourceType & $primitiveResourceType, |
|
735 | 735 | $primitiveValue |
736 | 736 | ) { |
737 | 737 | $type = $primitiveResourceType->getInstanceType(); |
@@ -770,9 +770,9 @@ discard block |
||
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 |
||
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, |
822 | 822 | $navigationProperties |
823 | 823 | ) { |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | if (28 < $resourceKind) { |
918 | 918 | return false; |
919 | 919 | } |
920 | - return 0 == ($resourceKind % 4); |
|
920 | + return 0 == ($resourceKind%4); |
|
921 | 921 | } |
922 | 922 | |
923 | 923 | |
@@ -935,9 +935,9 @@ discard block |
||
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 | ) { |
@@ -570,7 +570,8 @@ |
||
570 | 570 | ); |
571 | 571 | $this->writeProperties($content); |
572 | 572 | $this->xmlWriter->endElement(); |
573 | - } else { //probably just a primitive string |
|
573 | + } else { |
|
574 | +//probably just a primitive string |
|
574 | 575 | $this->xmlWriter->startElementNs( |
575 | 576 | ODataConstants::ODATA_NAMESPACE_PREFIX, |
576 | 577 | ODataConstants::COLLECTION_ELEMENT_NAME, |