@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | protected function executePut() |
210 | 210 | { |
211 | - return $this->executeBase(function ($uriProcessor, $segment) { |
|
211 | + return $this->executeBase(function($uriProcessor, $segment) { |
|
212 | 212 | $requestMethod = $uriProcessor->getService()->getOperationContext()->incomingRequest()->getMethod(); |
213 | 213 | $resourceSet = $segment->getTargetResourceSetWrapper(); |
214 | 214 | $keyDescriptor = $segment->getKeyDescriptor(); |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | protected function executeDelete() |
233 | 233 | { |
234 | - return $this->executeBase(function ($uriProcessor, $segment) { |
|
234 | + return $this->executeBase(function($uriProcessor, $segment) { |
|
235 | 235 | $requestMethod = $uriProcessor->getService()->getOperationContext()->incomingRequest()->getMethod(); |
236 | 236 | $resourceSet = $segment->getTargetResourceSetWrapper(); |
237 | 237 | $keyDescriptor = $segment->getKeyDescriptor(); |
@@ -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) { |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | */ |
330 | 330 | private function writeFeedElements( |
331 | 331 | &$entryObjects, |
332 | - ResourceType &$resourceType, |
|
332 | + ResourceType & $resourceType, |
|
333 | 333 | $title, |
334 | 334 | $absoluteUri, |
335 | 335 | $relativeUri, |
336 | - ODataFeed &$feed |
|
336 | + ODataFeed & $feed |
|
337 | 337 | ) { |
338 | 338 | assert(is_array($entryObjects), '!_writeFeedElements::is_array($entryObjects)'); |
339 | 339 | $feed->id = $absoluteUri; |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | */ |
384 | 384 | private function writeObjectProperties( |
385 | 385 | $customObject, |
386 | - ResourceType &$resourceType, |
|
386 | + ResourceType & $resourceType, |
|
387 | 387 | $absoluteUri, |
388 | 388 | $relativeUri, |
389 | 389 | &$odataEntry, |
390 | - ODataPropertyContent &$odataPropertyContent |
|
390 | + ODataPropertyContent & $odataPropertyContent |
|
391 | 391 | ) { |
392 | 392 | $resourceTypeKind = $resourceType->getResourceTypeKind(); |
393 | 393 | if (is_null($absoluteUri) == (ResourceTypeKind::ENTITY == $resourceTypeKind) |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | */ |
509 | 509 | private function writePrimitiveValue( |
510 | 510 | &$primitiveValue, |
511 | - ODataProperty &$odataProperty, |
|
512 | - ResourceProperty &$resourceProperty |
|
511 | + ODataProperty & $odataProperty, |
|
512 | + ResourceProperty & $resourceProperty |
|
513 | 513 | ) { |
514 | 514 | if (is_object($primitiveValue)) { |
515 | 515 | //TODO ERROR: The property 'PropertyName' |
@@ -543,9 +543,9 @@ discard block |
||
543 | 543 | private function writeComplexValue( |
544 | 544 | &$complexValue, |
545 | 545 | $propertyName, |
546 | - ResourceType &$resourceType, |
|
546 | + ResourceType & $resourceType, |
|
547 | 547 | $relativeUri, |
548 | - ODataPropertyContent &$odataPropertyContent |
|
548 | + ODataPropertyContent & $odataPropertyContent |
|
549 | 549 | ) { |
550 | 550 | $odataProperty = new ODataProperty(); |
551 | 551 | $odataProperty->name = $propertyName; |
@@ -584,9 +584,9 @@ discard block |
||
584 | 584 | private function writeBagValue( |
585 | 585 | &$BagValue, |
586 | 586 | $propertyName, |
587 | - ResourceType &$resourceType, |
|
587 | + ResourceType & $resourceType, |
|
588 | 588 | $relativeUri, |
589 | - ODataPropertyContent &$odataPropertyContent |
|
589 | + ODataPropertyContent & $odataPropertyContent |
|
590 | 590 | ) { |
591 | 591 | assert(null == $BagValue || is_array($BagValue), 'Bag parameter must be null or array'); |
592 | 592 | $bagItemResourceTypeKind = $resourceType->getResourceTypeKind(); |
@@ -643,10 +643,10 @@ discard block |
||
643 | 643 | */ |
644 | 644 | private function writeMediaResourceMetadata( |
645 | 645 | $entryObject, |
646 | - ResourceType &$resourceType, |
|
646 | + ResourceType & $resourceType, |
|
647 | 647 | $title, |
648 | 648 | $relativeUri, |
649 | - ODataEntry &$odataEntry |
|
649 | + ODataEntry & $odataEntry |
|
650 | 650 | ) { |
651 | 651 | $streamProviderWrapper = $this->getService()->getStreamProviderWrapper(); |
652 | 652 | assert(null != $streamProviderWrapper, "Retrieved stream provider must not be null"); |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | * @return string |
713 | 713 | */ |
714 | 714 | private function primitiveToString( |
715 | - ResourceType &$primitiveResourceType, |
|
715 | + ResourceType & $primitiveResourceType, |
|
716 | 716 | $primitiveValue |
717 | 717 | ) { |
718 | 718 | $type = $primitiveResourceType->getInstanceType(); |
@@ -751,9 +751,9 @@ discard block |
||
751 | 751 | private function complexObjectToContent( |
752 | 752 | &$complexValue, |
753 | 753 | $propertyName, |
754 | - ResourceType &$resourceType, |
|
754 | + ResourceType & $resourceType, |
|
755 | 755 | $relativeUri, |
756 | - ODataPropertyContent &$odataPropertyContent |
|
756 | + ODataPropertyContent & $odataPropertyContent |
|
757 | 757 | ) { |
758 | 758 | $count = count($this->complexTypeInstanceCollection); |
759 | 759 | for ($i = 0; $i < $count; ++$i) { |
@@ -796,9 +796,9 @@ discard block |
||
796 | 796 | */ |
797 | 797 | private function writeObjectPropertiesUnexpanded( |
798 | 798 | $customObject, |
799 | - ResourceType &$resourceType, |
|
799 | + ResourceType & $resourceType, |
|
800 | 800 | $relativeUri, |
801 | - ODataPropertyContent &$odataPropertyContent, |
|
801 | + ODataPropertyContent & $odataPropertyContent, |
|
802 | 802 | $resourceTypeKind, |
803 | 803 | $navigationProperties |
804 | 804 | ) { |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | if (28 < $resourceKind) { |
897 | 897 | return false; |
898 | 898 | } |
899 | - return 0 == ($resourceKind % 4); |
|
899 | + return 0 == ($resourceKind%4); |
|
900 | 900 | } |
901 | 901 | |
902 | 902 | |
@@ -914,9 +914,9 @@ discard block |
||
914 | 914 | */ |
915 | 915 | private function writeObjectPropertiesExpanded( |
916 | 916 | $customObject, |
917 | - ResourceType &$resourceType, |
|
917 | + ResourceType & $resourceType, |
|
918 | 918 | $relativeUri, |
919 | - ODataPropertyContent &$odataPropertyContent, |
|
919 | + ODataPropertyContent & $odataPropertyContent, |
|
920 | 920 | $projectionNodes, |
921 | 921 | $navigationProperties |
922 | 922 | ) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return ODataPropertyContent |
64 | 64 | */ |
65 | - public function writeTopLevelComplexObject(&$complexValue, $propertyName, ResourceType &$resourceType); |
|
65 | + public function writeTopLevelComplexObject(&$complexValue, $propertyName, ResourceType & $resourceType); |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Write top level bag resource. |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * |
77 | 77 | * @return ODataPropertyContent |
78 | 78 | */ |
79 | - public function writeTopLevelBagObject(&$BagValue, $propertyName, ResourceType &$resourceType); |
|
79 | + public function writeTopLevelBagObject(&$BagValue, $propertyName, ResourceType & $resourceType); |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Write top level primitive value. |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return ODataPropertyContent |
92 | 92 | */ |
93 | - public function writeTopLevelPrimitive(&$primitiveValue, ResourceProperty &$resourceProperty = null); |
|
93 | + public function writeTopLevelPrimitive(&$primitiveValue, ResourceProperty & $resourceProperty = null); |
|
94 | 94 | |
95 | 95 | /** |
96 | 96 | * Gets reference to the request submitted by client. |
@@ -804,7 +804,7 @@ |
||
804 | 804 | |
805 | 805 | /** |
806 | 806 | * @param ResourceSet $resourceSet The entity set containing the entity to fetch |
807 | - * @param object $sourceEntityInstance The source entity instance |
|
807 | + * @param KeyDescriptor $sourceEntityInstance The source entity instance |
|
808 | 808 | * @param object $data The New data for the entity instance. |
809 | 809 | * |
810 | 810 | * returns object|null returns the newly created model if sucessful or null if model creation failed. |