@@ -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) { | 
                                                        
@@ -214,7 +214,7 @@ discard block  | 
                                                    ||
| 214 | 214 | public function writeTopLevelBagObject(  | 
                                                        
| 215 | 215 | &$BagValue,  | 
                                                        
| 216 | 216 | $propertyName,  | 
                                                        
| 217 | - ResourceType &$resourceType  | 
                                                        |
| 217 | + ResourceType & $resourceType  | 
                                                        |
| 218 | 218 |      ) { | 
                                                        
| 219 | 219 | $propertyContent = new ODataPropertyContent();  | 
                                                        
| 220 | 220 | $this->writeBagValue(  | 
                                                        
@@ -242,7 +242,7 @@ discard block  | 
                                                    ||
| 242 | 242 | */  | 
                                                        
| 243 | 243 | public function writeTopLevelPrimitive(  | 
                                                        
| 244 | 244 | &$primitiveValue,  | 
                                                        
| 245 | - ResourceProperty &$resourceProperty = null  | 
                                                        |
| 245 | + ResourceProperty & $resourceProperty = null  | 
                                                        |
| 246 | 246 |      ) { | 
                                                        
| 247 | 247 | assert(null != $resourceProperty, "Resource property must not be null");  | 
                                                        
| 248 | 248 | $propertyContent = new ODataPropertyContent();  | 
                                                        
@@ -330,11 +330,11 @@ discard block  | 
                                                    ||
| 330 | 330 | */  | 
                                                        
| 331 | 331 | private function writeFeedElements(  | 
                                                        
| 332 | 332 | &$entryObjects,  | 
                                                        
| 333 | - ResourceType &$resourceType,  | 
                                                        |
| 333 | + ResourceType & $resourceType,  | 
                                                        |
| 334 | 334 | $title,  | 
                                                        
| 335 | 335 | $absoluteUri,  | 
                                                        
| 336 | 336 | $relativeUri,  | 
                                                        
| 337 | - ODataFeed &$feed  | 
                                                        |
| 337 | + ODataFeed & $feed  | 
                                                        |
| 338 | 338 |      ) { | 
                                                        
| 339 | 339 | assert(is_array($entryObjects), '!_writeFeedElements::is_array($entryObjects)');  | 
                                                        
| 340 | 340 | $feed->id = $absoluteUri;  | 
                                                        
@@ -384,11 +384,11 @@ discard block  | 
                                                    ||
| 384 | 384 | */  | 
                                                        
| 385 | 385 | private function writeObjectProperties(  | 
                                                        
| 386 | 386 | $customObject,  | 
                                                        
| 387 | - ResourceType &$resourceType,  | 
                                                        |
| 387 | + ResourceType & $resourceType,  | 
                                                        |
| 388 | 388 | $absoluteUri,  | 
                                                        
| 389 | 389 | $relativeUri,  | 
                                                        
| 390 | 390 | &$odataEntry,  | 
                                                        
| 391 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 391 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 392 | 392 |      ) { | 
                                                        
| 393 | 393 | $resourceTypeKind = $resourceType->getResourceTypeKind();  | 
                                                        
| 394 | 394 | if (is_null($absoluteUri) == (ResourceTypeKind::ENTITY == $resourceTypeKind)  | 
                                                        
@@ -509,8 +509,8 @@ discard block  | 
                                                    ||
| 509 | 509 | */  | 
                                                        
| 510 | 510 | private function writePrimitiveValue(  | 
                                                        
| 511 | 511 | &$primitiveValue,  | 
                                                        
| 512 | - ODataProperty &$odataProperty,  | 
                                                        |
| 513 | - ResourceProperty &$resourceProperty  | 
                                                        |
| 512 | + ODataProperty & $odataProperty,  | 
                                                        |
| 513 | + ResourceProperty & $resourceProperty  | 
                                                        |
| 514 | 514 |      ) { | 
                                                        
| 515 | 515 |          if (is_object($primitiveValue)) { | 
                                                        
| 516 | 516 | //TODO ERROR: The property 'PropertyName'  | 
                                                        
@@ -544,9 +544,9 @@ discard block  | 
                                                    ||
| 544 | 544 | private function writeComplexValue(  | 
                                                        
| 545 | 545 | &$complexValue,  | 
                                                        
| 546 | 546 | $propertyName,  | 
                                                        
| 547 | - ResourceType &$resourceType,  | 
                                                        |
| 547 | + ResourceType & $resourceType,  | 
                                                        |
| 548 | 548 | $relativeUri,  | 
                                                        
| 549 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 549 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 550 | 550 |      ) { | 
                                                        
| 551 | 551 | $odataProperty = new ODataProperty();  | 
                                                        
| 552 | 552 | $odataProperty->name = $propertyName;  | 
                                                        
@@ -585,9 +585,9 @@ discard block  | 
                                                    ||
| 585 | 585 | private function writeBagValue(  | 
                                                        
| 586 | 586 | &$BagValue,  | 
                                                        
| 587 | 587 | $propertyName,  | 
                                                        
| 588 | - ResourceType &$resourceType,  | 
                                                        |
| 588 | + ResourceType & $resourceType,  | 
                                                        |
| 589 | 589 | $relativeUri,  | 
                                                        
| 590 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 590 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 591 | 591 |      ) { | 
                                                        
| 592 | 592 | assert(null == $BagValue || is_array($BagValue), 'Bag parameter must be null or array');  | 
                                                        
| 593 | 593 | $bagItemResourceTypeKind = $resourceType->getResourceTypeKind();  | 
                                                        
@@ -644,10 +644,10 @@ discard block  | 
                                                    ||
| 644 | 644 | */  | 
                                                        
| 645 | 645 | private function writeMediaResourceMetadata(  | 
                                                        
| 646 | 646 | $entryObject,  | 
                                                        
| 647 | - ResourceType &$resourceType,  | 
                                                        |
| 647 | + ResourceType & $resourceType,  | 
                                                        |
| 648 | 648 | $title,  | 
                                                        
| 649 | 649 | $relativeUri,  | 
                                                        
| 650 | - ODataEntry &$odataEntry  | 
                                                        |
| 650 | + ODataEntry & $odataEntry  | 
                                                        |
| 651 | 651 |      ) { | 
                                                        
| 652 | 652 | $streamProviderWrapper = $this->getService()->getStreamProviderWrapper();  | 
                                                        
| 653 | 653 | assert(null != $streamProviderWrapper, "Retrieved stream provider must not be null");  | 
                                                        
@@ -713,7 +713,7 @@ discard block  | 
                                                    ||
| 713 | 713 | * @return string  | 
                                                        
| 714 | 714 | */  | 
                                                        
| 715 | 715 | private function primitiveToString(  | 
                                                        
| 716 | - ResourceType &$primitiveResourceType,  | 
                                                        |
| 716 | + ResourceType & $primitiveResourceType,  | 
                                                        |
| 717 | 717 | $primitiveValue  | 
                                                        
| 718 | 718 |      ) { | 
                                                        
| 719 | 719 | $type = $primitiveResourceType->getInstanceType();  | 
                                                        
@@ -752,9 +752,9 @@ discard block  | 
                                                    ||
| 752 | 752 | private function complexObjectToContent(  | 
                                                        
| 753 | 753 | &$complexValue,  | 
                                                        
| 754 | 754 | $propertyName,  | 
                                                        
| 755 | - ResourceType &$resourceType,  | 
                                                        |
| 755 | + ResourceType & $resourceType,  | 
                                                        |
| 756 | 756 | $relativeUri,  | 
                                                        
| 757 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 757 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 758 | 758 |      ) { | 
                                                        
| 759 | 759 | $count = count($this->complexTypeInstanceCollection);  | 
                                                        
| 760 | 760 |          for ($i = 0; $i < $count; ++$i) { | 
                                                        
@@ -797,9 +797,9 @@ discard block  | 
                                                    ||
| 797 | 797 | */  | 
                                                        
| 798 | 798 | private function writeObjectPropertiesUnexpanded(  | 
                                                        
| 799 | 799 | $customObject,  | 
                                                        
| 800 | - ResourceType &$resourceType,  | 
                                                        |
| 800 | + ResourceType & $resourceType,  | 
                                                        |
| 801 | 801 | $relativeUri,  | 
                                                        
| 802 | - ODataPropertyContent &$odataPropertyContent,  | 
                                                        |
| 802 | + ODataPropertyContent & $odataPropertyContent,  | 
                                                        |
| 803 | 803 | $resourceTypeKind,  | 
                                                        
| 804 | 804 | $navigationProperties  | 
                                                        
| 805 | 805 |      ) { | 
                                                        
@@ -897,7 +897,7 @@ discard block  | 
                                                    ||
| 897 | 897 |          if (28 < $resourceKind) { | 
                                                        
| 898 | 898 | return false;  | 
                                                        
| 899 | 899 | }  | 
                                                        
| 900 | - return 0 == ($resourceKind % 4);  | 
                                                        |
| 900 | + return 0 == ($resourceKind%4);  | 
                                                        |
| 901 | 901 | }  | 
                                                        
| 902 | 902 | |
| 903 | 903 | |
@@ -915,9 +915,9 @@ discard block  | 
                                                    ||
| 915 | 915 | */  | 
                                                        
| 916 | 916 | private function writeObjectPropertiesExpanded(  | 
                                                        
| 917 | 917 | $customObject,  | 
                                                        
| 918 | - ResourceType &$resourceType,  | 
                                                        |
| 918 | + ResourceType & $resourceType,  | 
                                                        |
| 919 | 919 | $relativeUri,  | 
                                                        
| 920 | - ODataPropertyContent &$odataPropertyContent,  | 
                                                        |
| 920 | + ODataPropertyContent & $odataPropertyContent,  | 
                                                        |
| 921 | 921 | $projectionNodes,  | 
                                                        
| 922 | 922 | $navigationProperties  | 
                                                        
| 923 | 923 |      ) { | 
                                                        
@@ -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.  |