@@ -78,7 +78,7 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | public function convertToOData($value) |
| 80 | 80 | { |
| 81 | - return $value . 'M'; |
|
| 81 | + return $value.'M'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -100,6 +100,6 @@ |
||
| 100 | 100 | */ |
| 101 | 101 | public function convertToOData($value) |
| 102 | 102 | { |
| 103 | - return $value . 'D'; |
|
| 103 | + return $value.'D'; |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | \ No newline at end of file |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | */ |
| 108 | 108 | public function convertToOData($value) |
| 109 | 109 | { |
| 110 | - return 'guid\'' . urlencode($value) . '\''; |
|
| 110 | + return 'guid\''.urlencode($value).'\''; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -96,6 +96,6 @@ |
||
| 96 | 96 | */ |
| 97 | 97 | public function convertToOData($value) |
| 98 | 98 | { |
| 99 | - return $value . 'L'; |
|
| 99 | + return $value.'L'; |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | \ No newline at end of file |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if ($resourceType->getResourceTypeKind() != ResourceTypeKind::COMPLEX |
| 32 | 32 | && $resourceType->getResourceTypeKind() != ResourceTypeKind::ENTITY |
| 33 | 33 | ) { |
| 34 | - throw new \InvalidArgumentException(Messages::navigationInvalidResourceType() ); |
|
| 34 | + throw new \InvalidArgumentException(Messages::navigationInvalidResourceType()); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $this->_resourceType = $resourceType; |
@@ -100,6 +100,6 @@ |
||
| 100 | 100 | */ |
| 101 | 101 | public function convertToOData($value) |
| 102 | 102 | { |
| 103 | - return $value . 'F'; |
|
| 103 | + return $value.'F'; |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | \ No newline at end of file |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | foreach ($resourceSets as $resourceSet) { |
| 180 | 180 | $name = $resourceSet->getName(); |
| 181 | 181 | if (in_array($name, $resourceSetNames)) { |
| 182 | - throw new ODataException(Messages::providersWrapperEntitySetNameShouldBeUnique($name), 500 ); |
|
| 182 | + throw new ODataException(Messages::providersWrapperEntitySetNameShouldBeUnique($name), 500); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | $resourceSetNames[] = $name; |
@@ -331,9 +331,9 @@ discard block |
||
| 331 | 331 | ResourceProperty $property |
| 332 | 332 | ) { |
| 333 | 333 | $type = $this->_getResourceTypeWherePropertyIsDeclared($type, $property); |
| 334 | - $cacheKey = $set->getName() . '_' . $type->getName() . '_' . $property->getName(); |
|
| 334 | + $cacheKey = $set->getName().'_'.$type->getName().'_'.$property->getName(); |
|
| 335 | 335 | |
| 336 | - if (array_key_exists($cacheKey, $this->associationSetCache)) { |
|
| 336 | + if (array_key_exists($cacheKey, $this->associationSetCache)) { |
|
| 337 | 337 | return $this->associationSetCache[$cacheKey]; |
| 338 | 338 | } |
| 339 | 339 | |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | return $resourceType->getAllProperties(); |
| 443 | 443 | } |
| 444 | 444 | //TODO: move this to doctrine annotations |
| 445 | - $cacheKey = $setWrapper->getName() . '_' . $resourceType->getFullName(); |
|
| 446 | - if (!array_key_exists($cacheKey, $this->propertyCache)) { |
|
| 445 | + $cacheKey = $setWrapper->getName().'_'.$resourceType->getFullName(); |
|
| 446 | + if (!array_key_exists($cacheKey, $this->propertyCache)) { |
|
| 447 | 447 | //Fill the cache |
| 448 | 448 | $this->propertyCache[$cacheKey] = array(); |
| 449 | 449 | foreach ($resourceType->getAllProperties() as $resourceProperty) { |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | |
| 587 | 587 | if (!$expressionProvider instanceof IExpressionProvider) |
| 588 | 588 | { |
| 589 | - throw ODataException::createInternalServerError( Messages::providersWrapperInvalidExpressionProviderInstance() ); |
|
| 589 | + throw ODataException::createInternalServerError(Messages::providersWrapperInvalidExpressionProviderInstance()); |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | return $expressionProvider; |
@@ -605,30 +605,30 @@ discard block |
||
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | |
| 608 | - private function ValidateQueryResult($queryResult, QueryType $queryType, $methodName){ |
|
| 608 | + private function ValidateQueryResult($queryResult, QueryType $queryType, $methodName) { |
|
| 609 | 609 | if (!$queryResult instanceof QueryResult) { |
| 610 | 610 | throw ODataException::createInternalServerError( |
| 611 | 611 | Messages::queryProviderReturnsNonQueryResult($methodName) |
| 612 | 612 | ); |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | - if($queryType == QueryType::COUNT() || $queryType == QueryType::ENTITIES_WITH_COUNT()){ |
|
| 615 | + if ($queryType == QueryType::COUNT() || $queryType == QueryType::ENTITIES_WITH_COUNT()) { |
|
| 616 | 616 | //and the provider is supposed to handle the ordered paging they must return a count! |
| 617 | - if($this->queryProvider->handlesOrderedPaging() && !is_numeric($queryResult->count)){ |
|
| 617 | + if ($this->queryProvider->handlesOrderedPaging() && !is_numeric($queryResult->count)) { |
|
| 618 | 618 | throw ODataException::createInternalServerError( |
| 619 | 619 | Messages::queryProviderResultCountMissing($methodName, $queryType) |
| 620 | 620 | ); |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | //If POData is supposed to handle the ordered aging they must return results! (possibly empty) |
| 624 | - if(!$this->queryProvider->handlesOrderedPaging() && !is_array($queryResult->results)){ |
|
| 624 | + if (!$this->queryProvider->handlesOrderedPaging() && !is_array($queryResult->results)) { |
|
| 625 | 625 | throw ODataException::createInternalServerError( |
| 626 | 626 | Messages::queryProviderResultsMissing($methodName, $queryType) |
| 627 | 627 | ); |
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | - if(($queryType == QueryType::ENTITIES() || $queryType == QueryType::ENTITIES_WITH_COUNT()) && !is_array($queryResult->results)){ |
|
| 631 | + if (($queryType == QueryType::ENTITIES() || $queryType == QueryType::ENTITIES_WITH_COUNT()) && !is_array($queryResult->results)) { |
|
| 632 | 632 | throw ODataException::createInternalServerError( |
| 633 | 633 | Messages::queryProviderResultsMissing($methodName, $queryType) |
| 634 | 634 | ); |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | */ |
| 677 | 677 | public function getResourceFromResourceSet(ResourceSet $resourceSet, KeyDescriptor $keyDescriptor) |
| 678 | 678 | { |
| 679 | - $entityInstance = $this->queryProvider->getResourceFromResourceSet( $resourceSet, $keyDescriptor ); |
|
| 679 | + $entityInstance = $this->queryProvider->getResourceFromResourceSet($resourceSet, $keyDescriptor); |
|
| 680 | 680 | $this->_validateEntityInstance( |
| 681 | 681 | $entityInstance, |
| 682 | 682 | $resourceSet, |
@@ -852,8 +852,8 @@ discard block |
||
| 852 | 852 | * @throws ODataException |
| 853 | 853 | */ |
| 854 | 854 | private function _validateEntityInstance($entityInstance, |
| 855 | - ResourceSet &$resourceSet, |
|
| 856 | - KeyDescriptor &$keyDescriptor, |
|
| 855 | + ResourceSet & $resourceSet, |
|
| 856 | + KeyDescriptor & $keyDescriptor, |
|
| 857 | 857 | $methodName |
| 858 | 858 | ) { |
| 859 | 859 | if (is_null($entityInstance)) { |
@@ -23,18 +23,18 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @throws \InvalidArgumentException if $count is not numeric |
| 25 | 25 | */ |
| 26 | - public static function adjustCountForPaging($count, $top, $skip){ |
|
| 26 | + public static function adjustCountForPaging($count, $top, $skip) { |
|
| 27 | 27 | |
| 28 | - if(!is_numeric($count)) throw new \InvalidArgumentException('$count'); |
|
| 28 | + if (!is_numeric($count)) throw new \InvalidArgumentException('$count'); |
|
| 29 | 29 | |
| 30 | 30 | //treat nulls like 0 |
| 31 | - if(is_null($skip)) $skip = 0; |
|
| 31 | + if (is_null($skip)) $skip = 0; |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | $count = $count - $skip; //eliminate the skipped records |
| 35 | - if($count < 0) return 0; //if there aren't enough to skip, the count is 0 |
|
| 35 | + if ($count < 0) return 0; //if there aren't enough to skip, the count is 0 |
|
| 36 | 36 | |
| 37 | - if(is_null($top)) return $count; //if there's no top, then it's the count as is |
|
| 37 | + if (is_null($top)) return $count; //if there's no top, then it's the count as is |
|
| 38 | 38 | |
| 39 | 39 | return min($count, $top); //count is top, unless there aren't enough records |
| 40 | 40 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $this->_verifyContentTypeOrETagModified('IDSSP::getReadStream'); |
| 107 | - } catch(ODataException $ex) { |
|
| 107 | + } catch (ODataException $ex) { |
|
| 108 | 108 | //Check for status code 304 (stream Not Modified) |
| 109 | 109 | if ($ex->getStatusCode() == 304) { |
| 110 | 110 | $eTag = $this->getStreamETag($entity, $resourceStreamInfo); |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | public function getDefaultStreamEditMediaUri($mediaLinkEntryUri, $resourceStreamInfo) |
| 475 | 475 | { |
| 476 | 476 | if (is_null($resourceStreamInfo)) { |
| 477 | - return rtrim($mediaLinkEntryUri, '/') . '/' . ODataConstants::URI_VALUE_SEGMENT; |
|
| 477 | + return rtrim($mediaLinkEntryUri, '/').'/'.ODataConstants::URI_VALUE_SEGMENT; |
|
| 478 | 478 | } else { |
| 479 | - return rtrim($mediaLinkEntryUri, '/') . '/' . ltrim($resourceStreamInfo->getName(), '/'); |
|
| 479 | + return rtrim($mediaLinkEntryUri, '/').'/'.ltrim($resourceStreamInfo->getName(), '/'); |
|
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | |