@@ -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'); |
@@ -158,8 +158,8 @@ |
||
158 | 158 | |
159 | 159 | case 'Edm.DateTime': |
160 | 160 | $dateTime = new Carbon($value, new \DateTimeZone('UTC')); |
161 | - $formattedDateTime = $dateTime->format('U') * 1000; |
|
162 | - $this->_writeCore('/Date('.$formattedDateTime.')/', /* quotes */ true); |
|
161 | + $formattedDateTime = $dateTime->format('U')*1000; |
|
162 | + $this->_writeCore('/Date(' . $formattedDateTime . ')/', /* quotes */ true); |
|
163 | 163 | break; |
164 | 164 | |
165 | 165 | case 'Edm.String': |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public static function resourceAssociationTypeEndPropertyMustBeNullOrInstanceofResourceProperty($argumentName) |
15 | 15 | { |
16 | - return "The argument '".$argumentName."' must be either null or instance of 'ResourceProperty'."; |
|
16 | + return "The argument '" . $argumentName . "' must be either null or instance of 'ResourceProperty'."; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -102,7 +102,7 @@ |
||
102 | 102 | |
103 | 103 | $a = $this->_isAscending ? 1 : -1; |
104 | 104 | |
105 | - $retVal = function ($object1, $object2) use ($ancestors, $a) { |
|
105 | + $retVal = function($object1, $object2) use ($ancestors, $a) { |
|
106 | 106 | $accessor1 = $object1; |
107 | 107 | $accessor2 = $object2; |
108 | 108 | $flag1 = is_null($accessor1); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use POData\Common\Messages; |
6 | 6 | use POData\Common\ODataException; |
7 | 7 | use POData\Providers\Metadata\ResourcePropertyKind; |
8 | -use POData\Providers\Metadata\ResourceSet; |
|
9 | 8 | use POData\Providers\Metadata\ResourceSetWrapper; |
10 | 9 | use POData\Providers\Metadata\ResourceType; |
11 | 10 | use POData\Providers\Metadata\ResourceTypeKind; |
@@ -11,7 +11,6 @@ |
||
11 | 11 | use POData\Providers\Metadata\ResourcePropertyKind; |
12 | 12 | use POData\Providers\Metadata\ResourceType; |
13 | 13 | use POData\Providers\Metadata\ResourceTypeKind; |
14 | -use POData\Providers\Metadata\ResourceStreamInfo; |
|
15 | 14 | use POData\Providers\Metadata\Type\Binary; |
16 | 15 | use POData\Providers\Metadata\Type\Boolean; |
17 | 16 | use POData\Providers\Metadata\Type\DateTime; |
@@ -892,6 +892,9 @@ |
||
892 | 892 | return [$odataPropertyContent, $navigationProperties]; |
893 | 893 | } |
894 | 894 | |
895 | + /** |
|
896 | + * @param ResourcePropertyKind $resourceKind |
|
897 | + */ |
|
895 | 898 | public static function isMatchPrimitive($resourceKind) |
896 | 899 | { |
897 | 900 | if (16 > $resourceKind) { |
@@ -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(); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @return ODataPropertyContent |
185 | 185 | */ |
186 | 186 | public function writeTopLevelComplexObject( |
187 | - QueryResult &$complexValue, |
|
187 | + QueryResult & $complexValue, |
|
188 | 188 | $propertyName, |
189 | 189 | ResourceType & $resourceType |
190 | 190 | ) { |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | * @return ODataPropertyContent |
211 | 211 | */ |
212 | 212 | public function writeTopLevelBagObject( |
213 | - QueryResult &$BagValue, |
|
213 | + QueryResult & $BagValue, |
|
214 | 214 | $propertyName, |
215 | - ResourceType &$resourceType |
|
215 | + ResourceType & $resourceType |
|
216 | 216 | ) { |
217 | 217 | $propertyContent = new ODataPropertyContent(); |
218 | 218 | $this->writeBagValue( |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | * @return ODataPropertyContent |
236 | 236 | */ |
237 | 237 | public function writeTopLevelPrimitive( |
238 | - QueryResult &$primitiveValue, |
|
239 | - ResourceProperty &$resourceProperty = null |
|
238 | + QueryResult & $primitiveValue, |
|
239 | + ResourceProperty & $resourceProperty = null |
|
240 | 240 | ) { |
241 | 241 | assert(null != $resourceProperty, "Resource property must not be null"); |
242 | 242 | $propertyContent = new ODataPropertyContent(); |
@@ -323,11 +323,11 @@ discard block |
||
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)'); |
@@ -378,11 +378,11 @@ discard block |
||
378 | 378 | */ |
379 | 379 | private function writeObjectProperties( |
380 | 380 | $customObject, |
381 | - ResourceType &$resourceType, |
|
381 | + ResourceType & $resourceType, |
|
382 | 382 | $absoluteUri, |
383 | 383 | $relativeUri, |
384 | 384 | &$odataEntry, |
385 | - ODataPropertyContent &$odataPropertyContent |
|
385 | + ODataPropertyContent & $odataPropertyContent |
|
386 | 386 | ) { |
387 | 387 | $resourceTypeKind = $resourceType->getResourceTypeKind(); |
388 | 388 | if (is_null($absoluteUri) == (ResourceTypeKind::ENTITY == $resourceTypeKind) |
@@ -505,8 +505,8 @@ discard block |
||
505 | 505 | */ |
506 | 506 | private function writePrimitiveValue( |
507 | 507 | &$primitiveValue, |
508 | - ODataProperty &$odataProperty, |
|
509 | - ResourceProperty &$resourceProperty |
|
508 | + ODataProperty & $odataProperty, |
|
509 | + ResourceProperty & $resourceProperty |
|
510 | 510 | ) { |
511 | 511 | if (is_object($primitiveValue)) { |
512 | 512 | //TODO ERROR: The property 'PropertyName' |
@@ -540,9 +540,9 @@ discard block |
||
540 | 540 | private function writeComplexValue( |
541 | 541 | &$complexValue, |
542 | 542 | $propertyName, |
543 | - ResourceType &$resourceType, |
|
543 | + ResourceType & $resourceType, |
|
544 | 544 | $relativeUri, |
545 | - ODataPropertyContent &$odataPropertyContent |
|
545 | + ODataPropertyContent & $odataPropertyContent |
|
546 | 546 | ) { |
547 | 547 | $odataProperty = new ODataProperty(); |
548 | 548 | $odataProperty->name = $propertyName; |
@@ -581,9 +581,9 @@ discard block |
||
581 | 581 | private function writeBagValue( |
582 | 582 | &$BagValue, |
583 | 583 | $propertyName, |
584 | - ResourceType &$resourceType, |
|
584 | + ResourceType & $resourceType, |
|
585 | 585 | $relativeUri, |
586 | - ODataPropertyContent &$odataPropertyContent |
|
586 | + ODataPropertyContent & $odataPropertyContent |
|
587 | 587 | ) { |
588 | 588 | assert(null == $BagValue || is_array($BagValue), 'Bag parameter must be null or array'); |
589 | 589 | $bagItemResourceTypeKind = $resourceType->getResourceTypeKind(); |
@@ -640,10 +640,10 @@ discard block |
||
640 | 640 | */ |
641 | 641 | private function writeMediaResourceMetadata( |
642 | 642 | $entryObject, |
643 | - ResourceType &$resourceType, |
|
643 | + ResourceType & $resourceType, |
|
644 | 644 | $title, |
645 | 645 | $relativeUri, |
646 | - ODataEntry &$odataEntry |
|
646 | + ODataEntry & $odataEntry |
|
647 | 647 | ) { |
648 | 648 | $streamProviderWrapper = $this->getService()->getStreamProviderWrapper(); |
649 | 649 | assert(null != $streamProviderWrapper, "Retrieved stream provider must not be null"); |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | * @return string |
717 | 717 | */ |
718 | 718 | private function primitiveToString( |
719 | - ResourceType &$primitiveResourceType, |
|
719 | + ResourceType & $primitiveResourceType, |
|
720 | 720 | $primitiveValue |
721 | 721 | ) { |
722 | 722 | $type = $primitiveResourceType->getInstanceType(); |
@@ -755,9 +755,9 @@ discard block |
||
755 | 755 | private function complexObjectToContent( |
756 | 756 | &$complexValue, |
757 | 757 | $propertyName, |
758 | - ResourceType &$resourceType, |
|
758 | + ResourceType & $resourceType, |
|
759 | 759 | $relativeUri, |
760 | - ODataPropertyContent &$odataPropertyContent |
|
760 | + ODataPropertyContent & $odataPropertyContent |
|
761 | 761 | ) { |
762 | 762 | $count = count($this->complexTypeInstanceCollection); |
763 | 763 | for ($i = 0; $i < $count; ++$i) { |
@@ -800,9 +800,9 @@ discard block |
||
800 | 800 | */ |
801 | 801 | private function writeObjectPropertiesUnexpanded( |
802 | 802 | $customObject, |
803 | - ResourceType &$resourceType, |
|
803 | + ResourceType & $resourceType, |
|
804 | 804 | $relativeUri, |
805 | - ODataPropertyContent &$odataPropertyContent, |
|
805 | + ODataPropertyContent & $odataPropertyContent, |
|
806 | 806 | $resourceTypeKind, |
807 | 807 | $navigationProperties |
808 | 808 | ) { |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | if (28 < $resourceKind) { |
902 | 902 | return false; |
903 | 903 | } |
904 | - return 0 == ($resourceKind % 4); |
|
904 | + return 0 == ($resourceKind%4); |
|
905 | 905 | } |
906 | 906 | |
907 | 907 | |
@@ -919,9 +919,9 @@ discard block |
||
919 | 919 | */ |
920 | 920 | private function writeObjectPropertiesExpanded( |
921 | 921 | $customObject, |
922 | - ResourceType &$resourceType, |
|
922 | + ResourceType & $resourceType, |
|
923 | 923 | $relativeUri, |
924 | - ODataPropertyContent &$odataPropertyContent, |
|
924 | + ODataPropertyContent & $odataPropertyContent, |
|
925 | 925 | $projectionNodes, |
926 | 926 | $navigationProperties |
927 | 927 | ) { |
@@ -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 |
@@ -410,7 +410,7 @@ |
||
410 | 410 | $this->topLevelComparisonFunction = $this->comparisonFunctions[0]; |
411 | 411 | } else { |
412 | 412 | $funcList = $this->comparisonFunctions; |
413 | - $this->topLevelComparisonFunction = function ($object1, $object2) use ($funcList) { |
|
413 | + $this->topLevelComparisonFunction = function($object1, $object2) use ($funcList) { |
|
414 | 414 | $ret = 0; |
415 | 415 | foreach ($funcList as $f) { |
416 | 416 | $ret = $f($object1, $object2); |
@@ -124,7 +124,7 @@ |
||
124 | 124 | * @param ResourceEntityType $resourceType Resource type for the source end |
125 | 125 | * @param ResourceProperty $resourceProperty Resource property for the source end |
126 | 126 | * |
127 | - * @return ResourceAssociationTypeEndRelated Association type end for the |
|
127 | + * @return ResourceAssociationTypeEnd|null Association type end for the |
|
128 | 128 | * given parameters |
129 | 129 | */ |
130 | 130 | public function getRelatedResourceAssociationSetEnd( |