@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | $inboundRequestHeaders = $this->setupHeaders(strtok("\n")); |
| 22 | 22 | |
| 23 | - $RequestBody = trim($RequestBody); |
|
| 23 | + $RequestBody = trim($RequestBody); |
|
| 24 | 24 | |
| 25 | 25 | $host = $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? $_SERVER['SERVER_ADDR'] ?? 'localhost'; |
| 26 | 26 | $protocol = $_SERVER['PROTOCOL'] = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) ? 'https' : 'http'; |
@@ -414,7 +414,7 @@ |
||
| 414 | 414 | |
| 415 | 415 | $textLen = strlen($text); |
| 416 | 416 | if ($textIndex >= $textLen || '.' != $text[$textIndex]) { |
| 417 | - return $qualityValue * 1000; |
|
| 417 | + return $qualityValue*1000; |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | ++$textIndex; |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | public static function validateWithoutPrefix(string $value, &$outValue) |
| 103 | 103 | { |
| 104 | 104 | $length = strlen($value); |
| 105 | - if (0 == $length || 0 != $length % 2) { |
|
| 105 | + if (0 == $length || 0 != $length%2) { |
|
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $type1 = $end1->getResourceType(); |
| 67 | 67 | $type2 = $end2->getResourceType(); |
| 68 | 68 | |
| 69 | - if ($type1 === $type2 && $prop1 === $prop2) { |
|
| 69 | + if ($type1 === $type2 && $prop1 === $prop2) { |
|
| 70 | 70 | throw new InvalidArgumentException( |
| 71 | 71 | Messages::resourceAssociationSetSelfReferencingAssociationCannotBeBiDirectional() |
| 72 | 72 | ); |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | $hasExpanded = null !== $link->getExpandedResult(); |
| 92 | 92 | |
| 93 | 93 | $isEntry = ($link->getExpandedResult() ? $link->getExpandedResult()->getData() : null) |
| 94 | - instanceof ODataEntry; |
|
| 94 | + instanceof ODataEntry; |
|
| 95 | 95 | |
| 96 | 96 | if ($hasExpanded) { |
| 97 | 97 | if ($isEntry) { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @throws InvalidOperationException |
| 58 | 58 | * @return mixed |
| 59 | 59 | */ |
| 60 | - public function processPayload(ODataEntry &$payload) |
|
| 60 | + public function processPayload(ODataEntry & $payload) |
|
| 61 | 61 | { |
| 62 | 62 | $entryOk = $this->isEntryOK($payload); |
| 63 | 63 | if (!$entryOk) { |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @throws InvalidOperationException |
| 129 | 129 | * @return array |
| 130 | 130 | */ |
| 131 | - protected function processEntryContent(ODataEntry &$content) |
|
| 131 | + protected function processEntryContent(ODataEntry & $content) |
|
| 132 | 132 | { |
| 133 | 133 | assert(null === $content->id || is_string($content->id), 'Entry id must be null or string'); |
| 134 | 134 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | assert($set instanceof ResourceSet, get_class($set)); |
| 138 | 138 | $type = $set->getResourceType(); |
| 139 | 139 | $properties = $this->getDeserialiser()->bulkDeserialise($type, $content); |
| 140 | - $properties = (object)$properties; |
|
| 140 | + $properties = (object) $properties; |
|
| 141 | 141 | |
| 142 | 142 | if ($isCreate) { |
| 143 | 143 | $result = $this->getWrapper()->createResourceforResourceSet($set, null, $properties); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @throws ODataException |
| 234 | 234 | * @throws ReflectionException |
| 235 | 235 | */ |
| 236 | - protected function processLink(ODataLink &$link, ResourceSet $sourceSet, $source) |
|
| 236 | + protected function processLink(ODataLink & $link, ResourceSet $sourceSet, $source) |
|
| 237 | 237 | { |
| 238 | 238 | $hasUrl = null !== $link->getUrl(); |
| 239 | 239 | $result = $link->getExpandedResult() ? $link->getExpandedResult()->getData() : null; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * @throws ReflectionException |
| 269 | 269 | * @throws Exception |
| 270 | 270 | */ |
| 271 | - protected function processLinkFeed(ODataLink &$link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
| 271 | + protected function processLinkFeed(ODataLink & $link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
| 272 | 272 | { |
| 273 | 273 | assert( |
| 274 | 274 | $link->getExpandedResult()->getData() instanceof ODataFeed, |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | * @throws ODataException |
| 359 | 359 | * @throws ReflectionException |
| 360 | 360 | */ |
| 361 | - protected function processLinkSingleton(ODataLink &$link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
| 361 | + protected function processLinkSingleton(ODataLink & $link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
| 362 | 362 | { |
| 363 | 363 | /** @var ODataEntry|null $result */ |
| 364 | 364 | $result = $link->getExpandedResult() ? $link->getExpandedResult()->getEntry() : null; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | assert($tagNamespace === ODataConstants::ODATA_NAMESPACE || |
| 51 | 51 | $tagNamespace === ODataConstants::ODATA_METADATA_NAMESPACE); |
| 52 | 52 | |
| 53 | - $property = new ODataProperty( |
|
| 53 | + $property = new ODataProperty( |
|
| 54 | 54 | $tagName, |
| 55 | 55 | $this->arrayKeyOrDefault( |
| 56 | 56 | $attributes, |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ODataConstants::ATOM_LINK_RELATION_ATTRIBUTE_NAME, |
| 85 | 85 | '' |
| 86 | 86 | ); |
| 87 | - $prop = $rel === ODataConstants::ATOM_SELF_RELATION_ATTRIBUTE_VALUE ? 'setSelfLink' : 'setNextPageLink'; |
|
| 87 | + $prop = $rel === ODataConstants::ATOM_SELF_RELATION_ATTRIBUTE_VALUE ? 'setSelfLink' : 'setNextPageLink'; |
|
| 88 | 88 | $this->oDataFeed->{$prop}(new ODataLink( |
| 89 | 89 | $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_LINK_RELATION_ATTRIBUTE_NAME, ''), |
| 90 | 90 | $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_TITLE_ELELMET_NAME, ''), |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function handleStartMetadataCount() |
| 98 | 98 | { |
| 99 | 99 | $this->enqueueEnd(function () { |
| 100 | - $this->oDataFeed->setRowCount((int)$this->popCharData()); |
|
| 100 | + $this->oDataFeed->setRowCount((int) $this->popCharData()); |
|
| 101 | 101 | }); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | */ |
| 77 | 77 | public function getTypeName(): string |
| 78 | 78 | { |
| 79 | - return $this->typeName ?? '' ; |
|
| 79 | + return $this->typeName ?? ''; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @throws InvalidOperationException |
| 125 | 125 | * @return ODataFeed |
| 126 | 126 | */ |
| 127 | - public function writeTopLevelElements(QueryResult &$entryObjects) |
|
| 127 | + public function writeTopLevelElements(QueryResult & $entryObjects) |
|
| 128 | 128 | { |
| 129 | 129 | $res = $entryObjects->results; |
| 130 | 130 | if (!(is_array($res))) { |
@@ -153,8 +153,7 @@ discard block |
||
| 153 | 153 | $nextLink = null; |
| 154 | 154 | |
| 155 | 155 | $rowCount = $this->getRequest()->queryType == QueryType::ENTITIES_WITH_COUNT() ? |
| 156 | - $this->getRequest()->getCountValue() : |
|
| 157 | - null; |
|
| 156 | + $this->getRequest()->getCountValue() : null; |
|
| 158 | 157 | foreach ($res as $entry) { |
| 159 | 158 | $query = $entry instanceof QueryResult ? $entry : new QueryResult($entry); |
| 160 | 159 | $entries[] = $this->writeTopLevelElement($query); |
@@ -287,7 +286,7 @@ discard block |
||
| 287 | 286 | |
| 288 | 287 | $resourceSet = $resourceType->getCustomState(); |
| 289 | 288 | assert($resourceSet instanceof ResourceSet); |
| 290 | - $type = $resourceType->getFullName(); |
|
| 289 | + $type = $resourceType->getFullName(); |
|
| 291 | 290 | |
| 292 | 291 | $relativeUri = $this->getEntryInstanceKey( |
| 293 | 292 | $entryObject->results, |
@@ -339,7 +338,7 @@ discard block |
||
| 339 | 338 | $links[] = $nuLink; |
| 340 | 339 | } |
| 341 | 340 | |
| 342 | - $odata = new ODataEntry( |
|
| 341 | + $odata = new ODataEntry( |
|
| 343 | 342 | $absoluteUri, |
| 344 | 343 | null, |
| 345 | 344 | new ODataTitle($resourceType->getName()), |
@@ -595,7 +594,7 @@ discard block |
||
| 595 | 594 | * @throws InvalidOperationException |
| 596 | 595 | * @return ODataBagContent|null |
| 597 | 596 | */ |
| 598 | - protected function writeBagValue(ResourceType &$resourceType, $result) |
|
| 597 | + protected function writeBagValue(ResourceType & $resourceType, $result) |
|
| 599 | 598 | { |
| 600 | 599 | $bagNullOrArray = null === $result || is_array($result); |
| 601 | 600 | if (!$bagNullOrArray) { |
@@ -639,7 +638,7 @@ discard block |
||
| 639 | 638 | * |
| 640 | 639 | * @return string |
| 641 | 640 | */ |
| 642 | - private function primitiveToString(IType &$type, $primitiveValue) |
|
| 641 | + private function primitiveToString(IType & $type, $primitiveValue) |
|
| 643 | 642 | { |
| 644 | 643 | if ($type instanceof Boolean) { |
| 645 | 644 | $stringValue = (true === $primitiveValue) ? 'true' : 'false'; |
@@ -665,7 +664,7 @@ discard block |
||
| 665 | 664 | * @throws InvalidOperationException |
| 666 | 665 | * @return ODataPropertyContent |
| 667 | 666 | */ |
| 668 | - protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null) |
|
| 667 | + protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null) |
|
| 669 | 668 | { |
| 670 | 669 | assert(is_object($result), 'Supplied $customObject must be an object'); |
| 671 | 670 | |
@@ -736,7 +735,7 @@ discard block |
||
| 736 | 735 | return false; |
| 737 | 736 | } |
| 738 | 737 | |
| 739 | - return 0 == ($value % 4); |
|
| 738 | + return 0 == ($value%4); |
|
| 740 | 739 | } |
| 741 | 740 | |
| 742 | 741 | /** |
@@ -819,7 +818,7 @@ discard block |
||
| 819 | 818 | $nuLink->getExpandedResult()->getData()->getSelfLink()->setTitle($propName); |
| 820 | 819 | $nuLink->getExpandedResult()->getData()->getSelfLink()->setUrl($nuLink->getUrl()); |
| 821 | 820 | $nuLink->getExpandedResult()->getData()->setTitle(new ODataTitle($propName)); |
| 822 | - $nuLink->getExpandedResult()->getData()->id = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->getUrl(); |
|
| 821 | + $nuLink->getExpandedResult()->getData()->id = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->getUrl(); |
|
| 823 | 822 | } |
| 824 | 823 | } |
| 825 | 824 | |
@@ -867,7 +866,7 @@ discard block |
||
| 867 | 866 | ODataConstants::HTTPQUERY_STRING_EXPAND, |
| 868 | 867 | ODataConstants::HTTPQUERY_STRING_ORDERBY, |
| 869 | 868 | ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
| 870 | - ODataConstants::HTTPQUERY_STRING_SELECT,] as $queryOption) { |
|
| 869 | + ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
| 871 | 870 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
| 872 | 871 | if (null !== $value) { |
| 873 | 872 | if (null !== $queryParameterString) { |
@@ -997,7 +996,7 @@ discard block |
||
| 997 | 996 | * @throws InvalidOperationException |
| 998 | 997 | * @return ODataPropertyContent |
| 999 | 998 | */ |
| 1000 | - public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType) |
|
| 999 | + public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType) |
|
| 1001 | 1000 | { |
| 1002 | 1001 | $result = $complexValue->results; |
| 1003 | 1002 | |
@@ -1030,11 +1029,11 @@ discard block |
||
| 1030 | 1029 | * @throws InvalidOperationException |
| 1031 | 1030 | * @return ODataPropertyContent |
| 1032 | 1031 | */ |
| 1033 | - public function writeTopLevelBagObject(QueryResult &$bagValue, $propertyName, ResourceType &$resourceType) |
|
| 1032 | + public function writeTopLevelBagObject(QueryResult & $bagValue, $propertyName, ResourceType & $resourceType) |
|
| 1034 | 1033 | { |
| 1035 | 1034 | $result = $bagValue->results; |
| 1036 | 1035 | |
| 1037 | - $odataProperty = new ODataProperty( |
|
| 1036 | + $odataProperty = new ODataProperty( |
|
| 1038 | 1037 | $propertyName, |
| 1039 | 1038 | 'Collection(' . $resourceType->getFullName() . ')', |
| 1040 | 1039 | $this->writeBagValue($resourceType, $result) |
@@ -1053,7 +1052,7 @@ discard block |
||
| 1053 | 1052 | * @throws InvalidOperationException |
| 1054 | 1053 | * @return ODataPropertyContent |
| 1055 | 1054 | */ |
| 1056 | - public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null) |
|
| 1055 | + public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null) |
|
| 1057 | 1056 | { |
| 1058 | 1057 | if (null === $resourceProperty) { |
| 1059 | 1058 | throw new InvalidOperationException('Resource property must not be null'); |