@@ -516,7 +516,7 @@ |
||
| 516 | 516 | $parent = $nullCheckExpTree; |
| 517 | 517 | $key = null; |
| 518 | 518 | do { |
| 519 | - $key = $parent->getResourceProperty()->getName().'_'.$key; |
|
| 519 | + $key = $parent->getResourceProperty()->getName() . '_' . $key; |
|
| 520 | 520 | $parent = $parent->getParent(); |
| 521 | 521 | } while ($parent != null); |
| 522 | 522 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | { |
| 84 | 84 | if ($this->Id != ExpressionTokenId::IDENTIFIER) { |
| 85 | 85 | throw ODataException::createSyntaxError( |
| 86 | - 'Identifier expected at position '.$this->Position |
|
| 86 | + 'Identifier expected at position ' . $this->Position |
|
| 87 | 87 | ); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -310,7 +310,7 @@ |
||
| 310 | 310 | && (ExpressionLexer::isNumeric($this->_getCurrentToken()->Id)) |
| 311 | 311 | ) { |
| 312 | 312 | $numberLiteral = $this->_getCurrentToken(); |
| 313 | - $numberLiteral->Text = '-'.$numberLiteral->Text; |
|
| 313 | + $numberLiteral->Text = '-' . $numberLiteral->Text; |
|
| 314 | 314 | $numberLiteral->Position = $op->Position; |
| 315 | 315 | $v = $this->_getCurrentToken(); |
| 316 | 316 | $this->_setCurrentToken($numberLiteral); |
@@ -345,7 +345,7 @@ |
||
| 345 | 345 | while ($this->_token->Id == ExpressionTokenId::DOT) { |
| 346 | 346 | $this->nextToken(); |
| 347 | 347 | $this->validateToken(ExpressionTokenId::IDENTIFIER); |
| 348 | - $identifier = $identifier.'.'.$this->_token->Text; |
|
| 348 | + $identifier = $identifier . '.' . $this->_token->Text; |
|
| 349 | 349 | $this->nextToken(); |
| 350 | 350 | } |
| 351 | 351 | |
@@ -102,7 +102,7 @@ discard block |
||
| 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); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $flag2 |= is_null($accessor2); |
| 118 | 118 | } |
| 119 | 119 | $propertyName = $this->propertyName; |
| 120 | - $getter = 'get'.ucfirst($propertyName); |
|
| 120 | + $getter = 'get' . ucfirst($propertyName); |
|
| 121 | 121 | if (!is_null($accessor1)) { |
| 122 | 122 | $accessor1 = method_exists($accessor1, $getter) ? $accessor1->$getter() : $accessor1->$propertyName; |
| 123 | 123 | } |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | if ($flag1 && $flag2) { |
| 132 | 132 | return 0; |
| 133 | 133 | } elseif ($flag1) { |
| 134 | - return $a * -1; |
|
| 134 | + return $a*-1; |
|
| 135 | 135 | } elseif ($flag2) { |
| 136 | - return $a * 1; |
|
| 136 | + return $a*1; |
|
| 137 | 137 | } |
| 138 | 138 | $type = $this->resourceProperty->getInstanceType(); |
| 139 | 139 | if ($type instanceof DateTime) { |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | $result = strcmp($accessor1, $accessor2); |
| 145 | 145 | } else { |
| 146 | 146 | $delta = $accessor1 - $accessor2; |
| 147 | - $result = (0 == $delta) ? 0 : $delta / abs($delta); |
|
| 147 | + $result = (0 == $delta) ? 0 : $delta/abs($delta); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - return $a * $result; |
|
| 150 | + return $a*$result; |
|
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | 153 | return $retVal; |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | // Also we can think about moving above urlencode to this |
| 182 | 182 | // function |
| 183 | 183 | $value = $type->convertToOData($currentObject); |
| 184 | - $nextPageLink .= $value.', '; |
|
| 184 | + $nextPageLink .= $value . ', '; |
|
| 185 | 185 | } |
| 186 | 186 | } catch (\ReflectionException $reflectionException) { |
| 187 | 187 | throw ODataException::createInternalServerError( |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $this->_topLevelComparisonFunction = $this->_comparisonFunctions[0]; |
| 401 | 401 | } else { |
| 402 | 402 | $funcList = $this->_comparisonFunctions; |
| 403 | - $BigFunc = function ($object1, $object2) use ($funcList) { |
|
| 403 | + $BigFunc = function($object1, $object2) use ($funcList) { |
|
| 404 | 404 | $ret = 0; |
| 405 | 405 | foreach ($funcList as $f) { |
| 406 | 406 | $ret = $f($object1, $object2); |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $lexer->validateToken(ExpressionTokenId::DOT); |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - $orderByPathSegments[$i][] = '*'.$identifier; |
|
| 452 | + $orderByPathSegments[$i][] = '*' . $identifier; |
|
| 453 | 453 | $lexer->nextToken(); |
| 454 | 454 | $tokenId = $lexer->getCurrentToken()->Id; |
| 455 | 455 | if ($tokenId != ExpressionTokenId::END) { |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @param bool $expanded Whether the navigation is expanded |
| 22 | 22 | * or not |
| 23 | 23 | */ |
| 24 | - public function __construct(ResourceProperty &$resourceProperty, $expanded) |
|
| 24 | + public function __construct(ResourceProperty & $resourceProperty, $expanded) |
|
| 25 | 25 | { |
| 26 | 26 | $this->resourceProperty = $resourceProperty; |
| 27 | 27 | $this->expanded = $expanded; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $this->service = $service; |
| 74 | 74 | $this->request = $request; |
| 75 | 75 | $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString(); |
| 76 | - $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/'; |
|
| 76 | + $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/'; |
|
| 77 | 77 | $this->stack = new SegmentStack($request); |
| 78 | 78 | $this->complexTypeInstanceCollection = []; |
| 79 | 79 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | $keyProperties = $resourceType->getKeyProperties(); |
| 142 | 142 | assert(count($keyProperties) != 0, 'count($keyProperties) == 0'); |
| 143 | - $keyString = $containerName.'('; |
|
| 143 | + $keyString = $containerName . '('; |
|
| 144 | 144 | $comma = null; |
| 145 | 145 | foreach ($keyProperties as $keyName => $resourceProperty) { |
| 146 | 146 | $keyType = $resourceProperty->getInstanceType(); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | $keyValue = $keyType->convertToOData($keyValue); |
| 156 | - $keyString .= $comma.$keyName.'='.$keyValue; |
|
| 156 | + $keyString .= $comma . $keyName . '=' . $keyValue; |
|
| 157 | 157 | $comma = ','; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | assert(!is_null($type) && $type instanceof IType, 'is_null($type) || $type not instanceof IType'); |
| 234 | 234 | $value = $this->getPropertyValue($entryObject, $resourceType, $eTagProperty); |
| 235 | 235 | if (is_null($value)) { |
| 236 | - $eTag = $eTag.$comma.'null'; |
|
| 236 | + $eTag = $eTag . $comma . 'null'; |
|
| 237 | 237 | } else { |
| 238 | - $eTag = $eTag.$comma.$type->convertToOData($value); |
|
| 238 | + $eTag = $eTag . $comma . $type->convertToOData($value); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | $comma = ','; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | // want this for eTag value. |
| 248 | 248 | $eTag = urldecode(utf8_decode($eTag)); |
| 249 | 249 | |
| 250 | - return ODataConstants::HTTP_WEAK_ETAG_PREFIX.rtrim($eTag, ',').'"'; |
|
| 250 | + return ODataConstants::HTTP_WEAK_ETAG_PREFIX . rtrim($eTag, ',') . '"'; |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * |
| 283 | 283 | * @return bool true if a segment was pushed, false otherwise |
| 284 | 284 | */ |
| 285 | - protected function pushSegmentForNavigationProperty(ResourceProperty &$resourceProperty) |
|
| 285 | + protected function pushSegmentForNavigationProperty(ResourceProperty & $resourceProperty) |
|
| 286 | 286 | { |
| 287 | 287 | if (ResourceTypeKind::ENTITY == $resourceProperty->getTypeKind()) { |
| 288 | 288 | assert(!empty($this->getStack()->getSegmentNames()), 'Segment names should not be empty'); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * |
| 394 | 394 | * @return bool true if the segment was push, false otherwise |
| 395 | 395 | */ |
| 396 | - private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper) |
|
| 396 | + private function _pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper) |
|
| 397 | 397 | { |
| 398 | 398 | // Even though there is no expand in the request URI, still we need to push |
| 399 | 399 | // the segment information if we need to count |
@@ -429,10 +429,10 @@ discard block |
||
| 429 | 429 | $queryParameterString = $this->getNextPageLinkQueryParametersForExpandedResourceSet(); |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | - $queryParameterString .= '$skip='.$skipToken; |
|
| 432 | + $queryParameterString .= '$skip=' . $skipToken; |
|
| 433 | 433 | $odataLink = new ODataLink(); |
| 434 | 434 | $odataLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING; |
| 435 | - $odataLink->url = rtrim($absoluteUri, '/').'?'.$queryParameterString; |
|
| 435 | + $odataLink->url = rtrim($absoluteUri, '/') . '?' . $queryParameterString; |
|
| 436 | 436 | |
| 437 | 437 | return $odataLink; |
| 438 | 438 | } |
@@ -457,10 +457,10 @@ discard block |
||
| 457 | 457 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
| 458 | 458 | if (!is_null($value)) { |
| 459 | 459 | if (!is_null($queryParameterString)) { |
| 460 | - $queryParameterString = $queryParameterString.'&'; |
|
| 460 | + $queryParameterString = $queryParameterString . '&'; |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | - $queryParameterString .= $queryOption.'='.$value; |
|
| 463 | + $queryParameterString .= $queryOption . '=' . $value; |
|
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $queryParameterString .= '&'; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP.'='.$remainingCount; |
|
| 474 | + $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP . '=' . $remainingCount; |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | if (!is_null($queryParameterString)) { |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | if (!is_null($selectionPaths)) { |
| 517 | - $queryParameterString = '$select='.$selectionPaths; |
|
| 517 | + $queryParameterString = '$select=' . $selectionPaths; |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | if (!is_null($expansionPaths)) { |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $queryParameterString .= '&'; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | - $queryParameterString = '$expand='.$expansionPaths; |
|
| 525 | + $queryParameterString = '$expand=' . $expansionPaths; |
|
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | if (!is_null($queryParameterString)) { |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | &$parentPathSegments, |
| 625 | 625 | &$selectionPaths, |
| 626 | 626 | &$expansionPaths, |
| 627 | - ExpandedProjectionNode &$expandedProjectionNode, |
|
| 627 | + ExpandedProjectionNode & $expandedProjectionNode, |
|
| 628 | 628 | &$foundSelections, |
| 629 | 629 | &$foundExpansions |
| 630 | 630 | ) { |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | $this->_appendSelectionOrExpandPath( |
| 659 | 659 | $selectionPaths, |
| 660 | 660 | $parentPathSegments, |
| 661 | - $childNode->getPropertyName().'/*' |
|
| 661 | + $childNode->getPropertyName() . '/*' |
|
| 662 | 662 | ); |
| 663 | 663 | } else { |
| 664 | 664 | $expandedChildrenNeededToBeSelected[] = $childNode; |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | foreach ($parentPathSegments as $parentPathSegment) { |
| 705 | - $path .= $parentPathSegment.'/'; |
|
| 705 | + $path .= $parentPathSegment . '/'; |
|
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | $path .= $segmentToAppend; |