@@ -216,7 +216,7 @@  | 
                                                    ||
| 216 | 216 | *  | 
                                                        
| 217 | 217 | * @return void  | 
                                                        
| 218 | 218 | */  | 
                                                        
| 219 | - public function getDataServiceAndEdmSchemaVersions(Version &$dsVersion, &$edmSchemaVersion)  | 
                                                        |
| 219 | + public function getDataServiceAndEdmSchemaVersions(Version & $dsVersion, &$edmSchemaVersion)  | 
                                                        |
| 220 | 220 |      { | 
                                                        
| 221 | 221 |          if ($this->_metadataResourceTypeSet->hasNamedStreams()) { | 
                                                        
| 222 | 222 | $dsVersion->raiseVersion(3, 0);  | 
                                                        
@@ -23,7 +23,7 @@  | 
                                                    ||
| 23 | 23 | * @param boolean $expanded Whether the navigation is expanded  | 
                                                        
| 24 | 24 | * or not.  | 
                                                        
| 25 | 25 | */  | 
                                                        
| 26 | - public function __construct(ResourceProperty &$resourceProperty, $expanded)  | 
                                                        |
| 26 | + public function __construct(ResourceProperty & $resourceProperty, $expanded)  | 
                                                        |
| 27 | 27 |      { | 
                                                        
| 28 | 28 | $this->resourceProperty = $resourceProperty;  | 
                                                        
| 29 | 29 | $this->expanded = $expanded;  | 
                                                        
@@ -72,8 +72,8 @@  | 
                                                    ||
| 72 | 72 | * orderby path segments.  | 
                                                        
| 73 | 73 | * @param ResourceType &$resourceType Reference to the type of the resource pointed by the request uri.  | 
                                                        
| 74 | 74 | */  | 
                                                        
| 75 | - public function __construct(InternalOrderByInfo &$internalOrderByInfo,  | 
                                                        |
| 76 | - $orderByValuesInSkipToken, ResourceType &$resourceType  | 
                                                        |
| 75 | + public function __construct(InternalOrderByInfo & $internalOrderByInfo,  | 
                                                        |
| 76 | + $orderByValuesInSkipToken, ResourceType & $resourceType  | 
                                                        |
| 77 | 77 |      ) { | 
                                                        
| 78 | 78 | $this->_internalOrderByInfo = $internalOrderByInfo;  | 
                                                        
| 79 | 79 | $this->_orderByValuesInSkipToken = $orderByValuesInSkipToken;  | 
                                                        
@@ -44,8 +44,8 @@  | 
                                                    ||
| 44 | 44 | * @throws ODataException  | 
                                                        
| 45 | 45 | */  | 
                                                        
| 46 | 46 | public static function parseSkipTokenClause(  | 
                                                        
| 47 | - ResourceType &$resourceType,  | 
                                                        |
| 48 | - InternalOrderByInfo &$internalOrderByInfo,  | 
                                                        |
| 47 | + ResourceType & $resourceType,  | 
                                                        |
| 48 | + InternalOrderByInfo & $internalOrderByInfo,  | 
                                                        |
| 49 | 49 | $skipToken  | 
                                                        
| 50 | 50 |      ) { | 
                                                        
| 51 | 51 | $tokenValueDescriptor = null;  | 
                                                        
@@ -40,7 +40,7 @@  | 
                                                    ||
| 40 | 40 | * @param array(int,(array(string,IType))) $orderByValuesInSkipToken Collection of values in the skiptoken corrosponds  | 
                                                        
| 41 | 41 | * to the orderby path segments.  | 
                                                        
| 42 | 42 | */  | 
                                                        
| 43 | - public function __construct(OrderByInfo &$orderByInfo, $orderByValuesInSkipToken)  | 
                                                        |
| 43 | + public function __construct(OrderByInfo & $orderByInfo, $orderByValuesInSkipToken)  | 
                                                        |
| 44 | 44 |      { | 
                                                        
| 45 | 45 | $this->_orderByInfo = $orderByInfo;  | 
                                                        
| 46 | 46 | $this->_orderByValuesInSkipToken = $orderByValuesInSkipToken;  | 
                                                        
@@ -281,14 +281,14 @@  | 
                                                    ||
| 281 | 281 | protected function writeNextPageLink(ODataLink $nextPageLinkUri = null)  | 
                                                        
| 282 | 282 |      { | 
                                                        
| 283 | 283 | |
| 284 | - // "__next" : uri  | 
                                                        |
| 285 | -		if ($nextPageLinkUri != null) { | 
                                                        |
| 286 | - $this->_writer  | 
                                                        |
| 287 | - ->writeName(ODataConstants::JSON_NEXT_STRING)  | 
                                                        |
| 288 | - ->writeValue($nextPageLinkUri->url);  | 
                                                        |
| 289 | - }  | 
                                                        |
| 290 | -  | 
                                                        |
| 291 | - return $this;  | 
                                                        |
| 284 | + // "__next" : uri  | 
                                                        |
| 285 | +        if ($nextPageLinkUri != null) { | 
                                                        |
| 286 | + $this->_writer  | 
                                                        |
| 287 | + ->writeName(ODataConstants::JSON_NEXT_STRING)  | 
                                                        |
| 288 | + ->writeValue($nextPageLinkUri->url);  | 
                                                        |
| 289 | + }  | 
                                                        |
| 290 | +  | 
                                                        |
| 291 | + return $this;  | 
                                                        |
| 292 | 292 | |
| 293 | 293 | }  | 
                                                        
| 294 | 294 | |
@@ -204,7 +204,7 @@ discard block  | 
                                                    ||
| 204 | 204 | public function writeTopLevelComplexObject(  | 
                                                        
| 205 | 205 | &$complexValue,  | 
                                                        
| 206 | 206 | $propertyName,  | 
                                                        
| 207 | - ResourceType &$resourceType  | 
                                                        |
| 207 | + ResourceType & $resourceType  | 
                                                        |
| 208 | 208 |      ) { | 
                                                        
| 209 | 209 | $propertyContent = new ODataPropertyContent();  | 
                                                        
| 210 | 210 | $this->_writeComplexValue(  | 
                                                        
@@ -231,7 +231,7 @@ discard block  | 
                                                    ||
| 231 | 231 | public function writeTopLevelBagObject(  | 
                                                        
| 232 | 232 | &$BagValue,  | 
                                                        
| 233 | 233 | $propertyName,  | 
                                                        
| 234 | - ResourceType &$resourceType  | 
                                                        |
| 234 | + ResourceType & $resourceType  | 
                                                        |
| 235 | 235 |      ) { | 
                                                        
| 236 | 236 | |
| 237 | 237 | $propertyContent = new ODataPropertyContent();  | 
                                                        
@@ -258,7 +258,7 @@ discard block  | 
                                                    ||
| 258 | 258 | */  | 
                                                        
| 259 | 259 | public function writeTopLevelPrimitive(  | 
                                                        
| 260 | 260 | &$primitiveValue,  | 
                                                        
| 261 | - ResourceProperty &$resourceProperty  | 
                                                        |
| 261 | + ResourceProperty & $resourceProperty  | 
                                                        |
| 262 | 262 |      ) { | 
                                                        
| 263 | 263 | $propertyContent = new ODataPropertyContent();  | 
                                                        
| 264 | 264 | $propertyContent->properties[] = new ODataProperty();  | 
                                                        
@@ -331,7 +331,7 @@ discard block  | 
                                                    ||
| 331 | 331 | $accept_ext = isset($matches['accept_ext']) ? $matches['accept_ext'] : '';  | 
                                                        
| 332 | 332 |              $accept_extensions_tmp = explode(';', trim($accept_ext, ' \n\r\t\v\0;')); | 
                                                        
| 333 | 333 | $accept_extensions = [];  | 
                                                        
| 334 | -            foreach($accept_extensions_tmp as $accept_extension) { | 
                                                        |
| 334 | +            foreach ($accept_extensions_tmp as $accept_extension) { | 
                                                        |
| 335 | 335 |                  $parts = explode('=', $accept_extension); | 
                                                        
| 336 | 336 | $accept_extensions[$parts[0]] = $accept_extension;  | 
                                                        
| 337 | 337 | }  | 
                                                        
@@ -373,11 +373,11 @@ discard block  | 
                                                    ||
| 373 | 373 | */  | 
                                                        
| 374 | 374 | private function _writeFeedElements(  | 
                                                        
| 375 | 375 | &$entryObjects,  | 
                                                        
| 376 | - ResourceType &$resourceType,  | 
                                                        |
| 376 | + ResourceType & $resourceType,  | 
                                                        |
| 377 | 377 | $title,  | 
                                                        
| 378 | 378 | $absoluteUri,  | 
                                                        
| 379 | 379 | $relativeUri,  | 
                                                        
| 380 | - ODataFeed &$feed  | 
                                                        |
| 380 | + ODataFeed & $feed  | 
                                                        |
| 381 | 381 |      ) { | 
                                                        
| 382 | 382 | $this->assert(is_iterable($entryObjects) || $entryObjects instanceof ArrayAccess, '_writeFeedElements::is_iterable($entryObjects)');  | 
                                                        
| 383 | 383 | $feed->id = $absoluteUri;  | 
                                                        
@@ -404,7 +404,7 @@ discard block  | 
                                                    ||
| 404 | 404 | |
| 405 | 405 | private function _writeCustomProperties(  | 
                                                        
| 406 | 406 | $customObject,  | 
                                                        
| 407 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 407 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 408 | 408 | )  | 
                                                        
| 409 | 409 |      { | 
                                                        
| 410 | 410 | $properties = $this->service->getQueryProvider()->getCustomProperties($customObject);  | 
                                                        
@@ -460,11 +460,11 @@ discard block  | 
                                                    ||
| 460 | 460 | */  | 
                                                        
| 461 | 461 | private function _writeObjectProperties(  | 
                                                        
| 462 | 462 | $customObject,  | 
                                                        
| 463 | - ResourceType &$resourceType,  | 
                                                        |
| 463 | + ResourceType & $resourceType,  | 
                                                        |
| 464 | 464 | $absoluteUri,  | 
                                                        
| 465 | 465 | $relativeUri,  | 
                                                        
| 466 | 466 | &$odataEntry,  | 
                                                        
| 467 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 467 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 468 | 468 |      ) { | 
                                                        
| 469 | 469 | $resourceTypeKind = $resourceType->getResourceTypeKind();  | 
                                                        
| 470 | 470 | if (is_null($absoluteUri) == ($resourceTypeKind == ResourceTypeKind::ENTITY)  | 
                                                        
@@ -719,7 +719,7 @@ discard block  | 
                                                    ||
| 719 | 719 | * @return void  | 
                                                        
| 720 | 720 | */  | 
                                                        
| 721 | 721 | private function _writePrimitiveValue(&$primitiveValue,  | 
                                                        
| 722 | - ResourceProperty &$resourceProperty, ODataProperty &$odataProperty  | 
                                                        |
| 722 | + ResourceProperty & $resourceProperty, ODataProperty & $odataProperty  | 
                                                        |
| 723 | 723 |      ) { | 
                                                        
| 724 | 724 |          if (is_object($primitiveValue)) { | 
                                                        
| 725 | 725 | //TODO ERROR: The property 'PropertyName'  | 
                                                        
@@ -763,8 +763,8 @@ discard block  | 
                                                    ||
| 763 | 763 | * @return void  | 
                                                        
| 764 | 764 | */  | 
                                                        
| 765 | 765 | private function _writeComplexValue(&$complexValue,  | 
                                                        
| 766 | - $propertyName, ResourceType &$resourceType, $relativeUri,  | 
                                                        |
| 767 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 766 | + $propertyName, ResourceType & $resourceType, $relativeUri,  | 
                                                        |
| 767 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 768 | 768 |      ) { | 
                                                        
| 769 | 769 | $odataProperty = new ODataProperty();  | 
                                                        
| 770 | 770 | $odataProperty->name = $propertyName;  | 
                                                        
@@ -803,8 +803,8 @@ discard block  | 
                                                    ||
| 803 | 803 | * @return void  | 
                                                        
| 804 | 804 | */  | 
                                                        
| 805 | 805 | private function _writeBagValue(&$BagValue,  | 
                                                        
| 806 | - $propertyName, ResourceType &$resourceType, $relativeUri,  | 
                                                        |
| 807 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 806 | + $propertyName, ResourceType & $resourceType, $relativeUri,  | 
                                                        |
| 807 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 808 | 808 |      ) { | 
                                                        
| 809 | 809 | $bagItemResourceTypeKind = $resourceType->getResourceTypeKind();  | 
                                                        
| 810 | 810 | $this->assert(  | 
                                                        
@@ -863,10 +863,10 @@ discard block  | 
                                                    ||
| 863 | 863 | */  | 
                                                        
| 864 | 864 | private function _writeMediaResourceMetadata(  | 
                                                        
| 865 | 865 | $entryObject,  | 
                                                        
| 866 | - ResourceType &$resourceType,  | 
                                                        |
| 866 | + ResourceType & $resourceType,  | 
                                                        |
| 867 | 867 | $title,  | 
                                                        
| 868 | 868 | $relativeUri,  | 
                                                        
| 869 | - ODataEntry &$odataEntry  | 
                                                        |
| 869 | + ODataEntry & $odataEntry  | 
                                                        |
| 870 | 870 |      ) { | 
                                                        
| 871 | 871 |          if ($resourceType->isMediaLinkEntry()) { | 
                                                        
| 872 | 872 | $odataEntry->isMediaLinkEntry = true;  | 
                                                        
@@ -913,7 +913,7 @@ discard block  | 
                                                    ||
| 913 | 913 | *  | 
                                                        
| 914 | 914 | * @return void  | 
                                                        
| 915 | 915 | */  | 
                                                        
| 916 | - private function _primitiveToString(ResourceType &$primtiveResourceType,  | 
                                                        |
| 916 | + private function _primitiveToString(ResourceType & $primtiveResourceType,  | 
                                                        |
| 917 | 917 | $primitiveValue, &$stringValue  | 
                                                        
| 918 | 918 |      ) { | 
                                                        
| 919 | 919 | $type = $primtiveResourceType->getInstanceType();  | 
                                                        
@@ -921,7 +921,7 @@ discard block  | 
                                                    ||
| 921 | 921 | $stringValue = ($primitiveValue === true) ? 'true' : 'false';  | 
                                                        
| 922 | 922 |          } else if ($type instanceof Binary) { | 
                                                        
| 923 | 923 |              if (is_resource($primitiveValue)) { | 
                                                        
| 924 | - $stringValue = 'data:'.mime_content_type($primitiveValue).';base64,'.base64_encode(stream_get_contents($primitiveValue));  | 
                                                        |
| 924 | + $stringValue = 'data:' . mime_content_type($primitiveValue) . ';base64,' . base64_encode(stream_get_contents($primitiveValue));  | 
                                                        |
| 925 | 925 |              } else { | 
                                                        
| 926 | 926 | $stringValue = base64_encode($primitiveValue);  | 
                                                        
| 927 | 927 | }  | 
                                                        
@@ -962,8 +962,8 @@ discard block  | 
                                                    ||
| 962 | 962 | * @return void  | 
                                                        
| 963 | 963 | */  | 
                                                        
| 964 | 964 | private function _complexObjectToContent(&$complexValue,  | 
                                                        
| 965 | - $propertyName, ResourceType &$resourceType, $relativeUri,  | 
                                                        |
| 966 | - ODataPropertyContent &$odataPropertyContent  | 
                                                        |
| 965 | + $propertyName, ResourceType & $resourceType, $relativeUri,  | 
                                                        |
| 966 | + ODataPropertyContent & $odataPropertyContent  | 
                                                        |
| 967 | 967 |      ) { | 
                                                        
| 968 | 968 | $count = count($this->complexTypeInstanceCollection);  | 
                                                        
| 969 | 969 |          for ($i = 0; $i < $count; $i++) { | 
                                                        
@@ -261,7 +261,7 @@ discard block  | 
                                                    ||
| 261 | 261 | * @throws InvalidOperationException If this function invoked with non-navigation  | 
                                                        
| 262 | 262 | * property instance.  | 
                                                        
| 263 | 263 | */  | 
                                                        
| 264 | - protected function pushSegmentForNavigationProperty(ResourceProperty &$resourceProperty)  | 
                                                        |
| 264 | + protected function pushSegmentForNavigationProperty(ResourceProperty & $resourceProperty)  | 
                                                        |
| 265 | 265 |      { | 
                                                        
| 266 | 266 |          if ($resourceProperty->getTypeKind() == ResourceTypeKind::ENTITY) { | 
                                                        
| 267 | 267 | $this->assert(!empty($this->_segmentNames), '!is_empty($this->_segmentNames');  | 
                                                        
@@ -374,7 +374,7 @@ discard block  | 
                                                    ||
| 374 | 374 | *  | 
                                                        
| 375 | 375 | * @return bool true if the segment was push, false otherwise  | 
                                                        
| 376 | 376 | */  | 
                                                        
| 377 | - private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper)  | 
                                                        |
| 377 | + private function _pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper)  | 
                                                        |
| 378 | 378 |      { | 
                                                        
| 379 | 379 | $rootProjectionNode = $this->request->getRootProjectionNode();  | 
                                                        
| 380 | 380 | // Even though there is no expand in the request URI, still we need to push  | 
                                                        
@@ -636,7 +636,7 @@ discard block  | 
                                                    ||
| 636 | 636 | */  | 
                                                        
| 637 | 637 | private function _buildSelectionAndExpansionPathsForNode(&$parentPathSegments,  | 
                                                        
| 638 | 638 | &$selectionPaths, &$expansionPaths,  | 
                                                        
| 639 | - ExpandedProjectionNode &$expandedProjectionNode,  | 
                                                        |
| 639 | + ExpandedProjectionNode & $expandedProjectionNode,  | 
                                                        |
| 640 | 640 | &$foundSelections, &$foundExpansions  | 
                                                        
| 641 | 641 |      ) { | 
                                                        
| 642 | 642 | $foundSelections = false;  | 
                                                        
@@ -160,7 +160,9 @@  | 
                                                    ||
| 160 | 160 | */  | 
                                                        
| 161 | 161 | protected function getPropertyValue($entity, ResourceType $resourceType, ResourceProperty $resourceProperty)  | 
                                                        
| 162 | 162 |      { | 
                                                        
| 163 | - if (is_array($entity)) return $entity[$resourceProperty->getName()];  | 
                                                        |
| 163 | +        if (is_array($entity)) { | 
                                                        |
| 164 | + return $entity[$resourceProperty->getName()];  | 
                                                        |
| 165 | + }  | 
                                                        |
| 164 | 166 | |
| 165 | 167 |          return $entity->{$resourceProperty->getName()}; | 
                                                        
| 166 | 168 | }  | 
                                                        
@@ -814,7 +814,7 @@ discard block  | 
                                                    ||
| 814 | 814 | *  | 
                                                        
| 815 | 815 | * @return void  | 
                                                        
| 816 | 816 | */  | 
                                                        
| 817 | - public function setInternalOrderByInfo(InternalOrderByInfo &$internalOrderByInfo)  | 
                                                        |
| 817 | + public function setInternalOrderByInfo(InternalOrderByInfo & $internalOrderByInfo)  | 
                                                        |
| 818 | 818 |      { | 
                                                        
| 819 | 819 | $this->internalOrderByInfo = $internalOrderByInfo;  | 
                                                        
| 820 | 820 | }  | 
                                                        
@@ -838,7 +838,7 @@ discard block  | 
                                                    ||
| 838 | 838 | * @return void  | 
                                                        
| 839 | 839 | */  | 
                                                        
| 840 | 840 | public function setInternalSkipTokenInfo(  | 
                                                        
| 841 | - InternalSkipTokenInfo &$internalSkipTokenInfo  | 
                                                        |
| 841 | + InternalSkipTokenInfo & $internalSkipTokenInfo  | 
                                                        |
| 842 | 842 |      ) { | 
                                                        
| 843 | 843 | $this->_internalSkipTokenInfo = $internalSkipTokenInfo;  | 
                                                        
| 844 | 844 | }  | 
                                                        
@@ -870,7 +870,7 @@ discard block  | 
                                                    ||
| 870 | 870 | *  | 
                                                        
| 871 | 871 | * @return void  | 
                                                        
| 872 | 872 | */  | 
                                                        
| 873 | - public function setRootProjectionNode(RootProjectionNode &$rootProjectionNode)  | 
                                                        |
| 873 | + public function setRootProjectionNode(RootProjectionNode & $rootProjectionNode)  | 
                                                        |
| 874 | 874 |      { | 
                                                        
| 875 | 875 | $this->_rootProjectionNode = $rootProjectionNode;  | 
                                                        
| 876 | 876 | }  |