@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | public static function requestVersionTooLow($requestedVersion, $requiredVersion) |
18 | 18 | { |
19 | 19 | return 'Request version \''.$requestedVersion.'\' is not supported for the request payload. The only' |
20 | - .' supported version is \''.$requiredVersion.'\'.'; |
|
20 | + .' supported version is \''.$requiredVersion.'\'.'; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public static function requestVersionIsBiggerThanProtocolVersion($requiredVersion, $configuredVersion) |
33 | 33 | { |
34 | 34 | return 'The response requires that version '.$requiredVersion.' of the protocol be used, but the' |
35 | - .' MaxProtocolVersion of the data service is set to '.$configuredVersion.'.'; |
|
35 | + .' MaxProtocolVersion of the data service is set to '.$configuredVersion.'.'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | $availableVersions |
66 | 66 | ) { |
67 | 67 | return 'The version value '.$requestedVersion.' in the header '.$requestHeaderName.' is not' |
68 | - .' supported, available versions are '.$availableVersions; |
|
68 | + .' supported, available versions are '.$availableVersions; |
|
69 | 69 | } |
70 | 70 | } |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public static function requestVersionTooLow($requestedVersion, $requiredVersion) |
18 | 18 | { |
19 | - return 'Request version \''.$requestedVersion.'\' is not supported for the request payload. The only' |
|
20 | - .' supported version is \''.$requiredVersion.'\'.'; |
|
19 | + return 'Request version \'' . $requestedVersion . '\' is not supported for the request payload. The only' |
|
20 | + .' supported version is \'' . $requiredVersion . '\'.'; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public static function requestVersionIsBiggerThanProtocolVersion($requiredVersion, $configuredVersion) |
33 | 33 | { |
34 | - return 'The response requires that version '.$requiredVersion.' of the protocol be used, but the' |
|
35 | - .' MaxProtocolVersion of the data service is set to '.$configuredVersion.'.'; |
|
34 | + return 'The response requires that version ' . $requiredVersion . ' of the protocol be used, but the' |
|
35 | + .' MaxProtocolVersion of the data service is set to ' . $configuredVersion . '.'; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function requestDescriptionInvalidVersionHeader($versionAsString, $headerName) |
48 | 48 | { |
49 | - return 'The header '.$headerName.' has malformed version value '.$versionAsString; |
|
49 | + return 'The header ' . $headerName . ' has malformed version value ' . $versionAsString; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $requestedVersion, |
65 | 65 | $availableVersions |
66 | 66 | ) { |
67 | - return 'The version value '.$requestedVersion.' in the header '.$requestHeaderName.' is not' |
|
68 | - .' supported, available versions are '.$availableVersions; |
|
67 | + return 'The version value ' . $requestedVersion . ' in the header ' . $requestHeaderName . ' is not' |
|
68 | + .' supported, available versions are ' . $availableVersions; |
|
69 | 69 | } |
70 | 70 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public static function orderByParserPropertyNotFound($resourceTypeName, $propertyName) |
51 | 51 | { |
52 | 52 | return 'Error in the \'orderby\' clause. Type ' . $resourceTypeName |
53 | - . ' does not have a property named \'' . $propertyName . '\'.'; |
|
53 | + . ' does not have a property named \'' . $propertyName . '\'.'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -179,6 +179,6 @@ discard block |
||
179 | 179 | public static function orderByParserFailedToAccessOrInitializeProperty($propertyName, $parentObjectName) |
180 | 180 | { |
181 | 181 | return 'OrderBy parser failed to access or initialize the property ' . $propertyName . |
182 | - ' of ' . $parentObjectName; |
|
182 | + ' of ' . $parentObjectName; |
|
183 | 183 | } |
184 | 184 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * |
195 | 195 | * @return bool true if a segment was pushed, false otherwise |
196 | 196 | */ |
197 | - private function pushSegmentForNavigationProperty(ResourceProperty &$resourceProperty) |
|
197 | + private function pushSegmentForNavigationProperty(ResourceProperty & $resourceProperty) |
|
198 | 198 | { |
199 | 199 | if ($resourceProperty->getTypeKind() == ResourceTypeKind::ENTITY()) { |
200 | 200 | assert(!empty($this->getStack()->getSegmentNames()), '!is_empty($this->getStack()->getSegmentNames())'); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * |
280 | 280 | * @return bool true if the segment was push, false otherwise |
281 | 281 | */ |
282 | - private function pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
282 | + private function pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper) |
|
283 | 283 | { |
284 | 284 | return $this->getStack()->pushSegment($segmentName, $resourceSetWrapper); |
285 | 285 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | - $builtServiceUri = $requestUriScheme .'://' . $this->getAbsoluteRequestUri()->getHost(); |
|
225 | + $builtServiceUri = $requestUriScheme . '://' . $this->getAbsoluteRequestUri()->getHost(); |
|
226 | 226 | |
227 | 227 | if (($requestUriScheme == 'http' && $requestUriPort != '80') || |
228 | 228 | ($requestUriScheme == 'https' && $requestUriPort != '443') |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | $this->getOperationContext()->outgoingResponse()->setContentLength($value); |
512 | 512 | } else { |
513 | 513 | throw ODataException::notAcceptableError( |
514 | - 'ContentLength: '.$value.' is invalid' |
|
514 | + 'ContentLength: ' . $value . ' is invalid' |
|
515 | 515 | ); |
516 | 516 | } |
517 | 517 | } |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | public function setResponseStatusCode($value) |
557 | 557 | { |
558 | 558 | if (!is_numeric($value)) { |
559 | - $msg = 'Invalid, non-numeric, status code: '.$value; |
|
559 | + $msg = 'Invalid, non-numeric, status code: ' . $value; |
|
560 | 560 | throw ODataException::createInternalServerError($msg); |
561 | 561 | } |
562 | 562 | $floor = floor($value/100); |
@@ -565,10 +565,10 @@ |
||
565 | 565 | { |
566 | 566 | $queryParameterString = null; |
567 | 567 | foreach ([ODataConstants::HTTPQUERY_STRING_FILTER, |
568 | - ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
569 | - ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
570 | - ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
571 | - ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
568 | + ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
569 | + ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
570 | + ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
571 | + ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
572 | 572 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
573 | 573 | if (null !== $value) { |
574 | 574 | if (null !== $queryParameterString) { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $this->isBaseWritten = true; |
129 | 129 | |
130 | 130 | $stackCount = count($this->lightStack); |
131 | - $topOfStack = $this->lightStack[$stackCount-1]; |
|
131 | + $topOfStack = $this->lightStack[$stackCount - 1]; |
|
132 | 132 | $resourceType = $this->getService()->getProvidersWrapper()->resolveResourceType($topOfStack['type']); |
133 | 133 | assert($resourceType instanceof ResourceType, get_class($resourceType)); |
134 | 134 | $rawProp = $resourceType->getAllProperties(); |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | $nonRelCount = count($nonRelProp); |
151 | 151 | assert( |
152 | 152 | $rawCount == $relCount + $nonRelCount, |
153 | - 'Raw property count '.$rawCount.', does not equal sum of relProp count, '.$relCount |
|
154 | - .', and nonRelPropCount,'.$nonRelCount |
|
153 | + 'Raw property count ' . $rawCount . ', does not equal sum of relProp count, ' . $relCount |
|
154 | + .', and nonRelPropCount,' . $nonRelCount |
|
155 | 155 | ); |
156 | 156 | |
157 | 157 | // now mask off against projNodes |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE' |
199 | 199 | ); |
200 | 200 | $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed'; |
201 | - $propType = 'application/atom+xml;type='.$propTail; |
|
201 | + $propType = 'application/atom+xml;type=' . $propTail; |
|
202 | 202 | $propName = $prop->getName(); |
203 | 203 | $nuLink->title = $propName; |
204 | 204 | $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName; |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | $newCount == $stackCount, |
236 | 236 | 'Should have ' . $stackCount . 'elements in stack, have ' . $newCount . 'elements' |
237 | 237 | ); |
238 | - $this->lightStack[$newCount-1]['count']--; |
|
239 | - if (0 == $this->lightStack[$newCount-1]['count']) { |
|
238 | + $this->lightStack[$newCount - 1]['count']--; |
|
239 | + if (0 == $this->lightStack[$newCount - 1]['count']) { |
|
240 | 240 | array_pop($this->lightStack); |
241 | 241 | } |
242 | 242 | return $odata; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @return ODataFeed |
251 | 251 | */ |
252 | - public function writeTopLevelElements(QueryResult &$entryObjects) |
|
252 | + public function writeTopLevelElements(QueryResult & $entryObjects) |
|
253 | 253 | { |
254 | 254 | assert(is_array($entryObjects->results), '!is_array($entryObjects->results)'); |
255 | 255 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | * |
375 | 375 | * @return ODataPropertyContent |
376 | 376 | */ |
377 | - public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType) |
|
377 | + public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType) |
|
378 | 378 | { |
379 | 379 | $result = $complexValue->results; |
380 | 380 | |
@@ -402,14 +402,14 @@ discard block |
||
402 | 402 | * |
403 | 403 | * @return ODataPropertyContent |
404 | 404 | */ |
405 | - public function writeTopLevelBagObject(QueryResult &$bagValue, $propertyName, ResourceType &$resourceType) |
|
405 | + public function writeTopLevelBagObject(QueryResult & $bagValue, $propertyName, ResourceType & $resourceType) |
|
406 | 406 | { |
407 | 407 | $result = $bagValue->results; |
408 | 408 | |
409 | 409 | $propertyContent = new ODataPropertyContent(); |
410 | 410 | $odataProperty = new ODataProperty(); |
411 | 411 | $odataProperty->name = $propertyName; |
412 | - $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')'; |
|
412 | + $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')'; |
|
413 | 413 | $odataProperty->value = $this->writeBagValue($resourceType, $result); |
414 | 414 | |
415 | 415 | $propertyContent->properties[$propertyName] = $odataProperty; |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | * |
425 | 425 | * @return ODataPropertyContent |
426 | 426 | */ |
427 | - public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null) |
|
427 | + public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null) |
|
428 | 428 | { |
429 | 429 | assert(null !== $resourceProperty, 'Resource property must not be null'); |
430 | 430 | $result = new ODataPropertyContent(); |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | * @param $result |
517 | 517 | * @return ODataBagContent|null |
518 | 518 | */ |
519 | - protected function writeBagValue(ResourceType &$resourceType, $result) |
|
519 | + protected function writeBagValue(ResourceType & $resourceType, $result) |
|
520 | 520 | { |
521 | 521 | assert(null === $result || is_array($result), 'Bag parameter must be null or array'); |
522 | 522 | $typeKind = $resourceType->getResourceTypeKind(); |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | * @param string|null $propertyName |
550 | 550 | * @return ODataPropertyContent |
551 | 551 | */ |
552 | - protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null) |
|
552 | + protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null) |
|
553 | 553 | { |
554 | 554 | assert(is_object($result), 'Supplied $customObject must be an object'); |
555 | 555 | |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | $skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject); |
704 | 704 | assert(null !== $skipToken, '!is_null($skipToken)'); |
705 | 705 | $token = (1 < $numSegments) ? '$skiptoken=' : '$skip='; |
706 | - $skipToken = '?'.$queryParameterString.$token.$skipToken; |
|
706 | + $skipToken = '?' . $queryParameterString . $token . $skipToken; |
|
707 | 707 | |
708 | 708 | return $skipToken; |
709 | 709 | } |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | * |
959 | 959 | * @return string |
960 | 960 | */ |
961 | - private function primitiveToString(IType &$type, $primitiveValue) |
|
961 | + private function primitiveToString(IType & $type, $primitiveValue) |
|
962 | 962 | { |
963 | 963 | if ($type instanceof Boolean) { |
964 | 964 | $stringValue = (true === $primitiveValue) ? 'true' : 'false'; |
@@ -983,6 +983,6 @@ discard block |
||
983 | 983 | if (28 < $resourceKind) { |
984 | 984 | return false; |
985 | 985 | } |
986 | - return 0 == ($resourceKind % 4); |
|
986 | + return 0 == ($resourceKind%4); |
|
987 | 987 | } |
988 | 988 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * @throws InvalidOperationException |
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'); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | */ |
682 | 682 | protected function compareETag( |
683 | 683 | &$entryObject, |
684 | - ResourceType &$resourceType, |
|
684 | + ResourceType & $resourceType, |
|
685 | 685 | &$needToSerializeResponse |
686 | 686 | ) { |
687 | 687 | $needToSerializeResponse = true; |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | * for use in a URI) there are etag properties, NULL if |
776 | 776 | * there is no etag property |
777 | 777 | */ |
778 | - protected function getETagForEntry(&$entryObject, ResourceType &$resourceType) |
|
778 | + protected function getETagForEntry(&$entryObject, ResourceType & $resourceType) |
|
779 | 779 | { |
780 | 780 | $eTag = null; |
781 | 781 | $comma = null; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $namespaceName = implode('.', $bitz); |
25 | 25 | } |
26 | 26 | $rawType = $entity->getBaseType(); |
27 | - $metaNamespace = $meta->getContainerNamespace().'.'; |
|
27 | + $metaNamespace = $meta->getContainerNamespace() . '.'; |
|
28 | 28 | |
29 | 29 | $rawType = (null !== $rawType) ? str_replace($metaNamespace, '', $rawType) : null; |
30 | 30 | $baseType = null === $rawType ? null : $meta->resolveResourceType($rawType); |
@@ -627,7 +627,7 @@ |
||
627 | 627 | $many = false |
628 | 628 | ) { |
629 | 629 | $allowedMult = ['*', '1', '0..1']; |
630 | - $backMultArray = [ '*' => '*', '1' => '0..1', '0..1' => '1']; |
|
630 | + $backMultArray = ['*' => '*', '1' => '0..1', '0..1' => '1']; |
|
631 | 631 | $this->checkInstanceProperty($name, $sourceResourceType); |
632 | 632 | |
633 | 633 | // check that property and resource name don't up and collide - would violate OData spec |