@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @param ODataEntry $payload |
39 | 39 | */ |
40 | - public function processPayload(ODataEntry &$payload) |
|
40 | + public function processPayload(ODataEntry & $payload) |
|
41 | 41 | { |
42 | 42 | assert($this->isEntryOK($payload)); |
43 | 43 | list($sourceSet, $source) = $this->processEntryContent($payload); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | return true; |
90 | 90 | } |
91 | 91 | |
92 | - protected function processEntryContent(ODataEntry &$content) |
|
92 | + protected function processEntryContent(ODataEntry & $content) |
|
93 | 93 | { |
94 | 94 | assert(null === $content->id || is_string($content->id), 'Entry id must be null or string'); |
95 | 95 | |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | $keyPredicate[strlen($keyPredicate) - 2] = ' '; |
165 | 165 | } else { |
166 | 166 | $idBits = explode('/', $id); |
167 | - $keyRaw = $idBits[count($idBits)-1]; |
|
167 | + $keyRaw = $idBits[count($idBits) - 1]; |
|
168 | 168 | $rawBits = explode('(', $keyRaw, 2); |
169 | - $rawBits = explode(')', $rawBits[count($rawBits)-1]); |
|
169 | + $rawBits = explode(')', $rawBits[count($rawBits) - 1]); |
|
170 | 170 | $keyPredicate = $rawBits[0]; |
171 | 171 | } |
172 | 172 | $keyPredicate = trim($keyPredicate); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | return $keyDesc; |
179 | 179 | } |
180 | 180 | |
181 | - protected function processLink(ODataLink &$link, ResourceSet $sourceSet, $source) |
|
181 | + protected function processLink(ODataLink & $link, ResourceSet $sourceSet, $source) |
|
182 | 182 | { |
183 | 183 | $hasUrl = isset($link->url); |
184 | 184 | $hasPayload = isset($link->expandedResult); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @param $hasUrl |
211 | 211 | * @param $hasPayload |
212 | 212 | */ |
213 | - protected function processLinkSingleton(ODataLink &$link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
213 | + protected function processLinkSingleton(ODataLink & $link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
214 | 214 | { |
215 | 215 | assert( |
216 | 216 | null === $link->expandedResult || $link->expandedResult instanceof ODataEntry, |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | return; |
267 | 267 | } |
268 | 268 | |
269 | - protected function processLinkFeed(ODataLink &$link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
269 | + protected function processLinkFeed(ODataLink & $link, ResourceSet $sourceSet, $source, $hasUrl, $hasPayload) |
|
270 | 270 | { |
271 | 271 | assert( |
272 | 272 | $link->expandedResult instanceof ODataFeed, |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param KeyDescriptor|null $keyDescriptor |
111 | 111 | * @return bool |
112 | 112 | */ |
113 | - protected static function parseAndVerifyRawKeyPredicate($keyString, $isKey, KeyDescriptor &$keyDescriptor = null) |
|
113 | + protected static function parseAndVerifyRawKeyPredicate($keyString, $isKey, KeyDescriptor & $keyDescriptor = null) |
|
114 | 114 | { |
115 | 115 | $result = self::tryParseKeysFromRawKeyPredicate( |
116 | 116 | $keyString, |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public static function tryParseKeysFromKeyPredicate( |
224 | 224 | $keyPredicate, |
225 | - KeyDescriptor &$keyDescriptor = null |
|
225 | + KeyDescriptor & $keyDescriptor = null |
|
226 | 226 | ) { |
227 | 227 | $isKey = true; |
228 | 228 | $keyString = $keyPredicate; |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | $comma = null; |
553 | 553 | foreach ($keys as $keyName => $resourceProperty) { |
554 | 554 | if (!array_key_exists($keyName, $namedKeys)) { |
555 | - $msg = 'Key predicate '.$keyName.' not present in named values'; |
|
555 | + $msg = 'Key predicate ' . $keyName . ' not present in named values'; |
|
556 | 556 | throw new \InvalidArgumentException($msg); |
557 | 557 | } |
558 | 558 | $keyType = $resourceProperty->getInstanceType(); |
@@ -165,7 +165,7 @@ |
||
165 | 165 | public function setStatusCode($value) |
166 | 166 | { |
167 | 167 | $rawCode = substr($value, 0, 3); |
168 | - assert(is_numeric($rawCode), 'Raw HTTP status code is not numeric - is '.$rawCode); |
|
168 | + assert(is_numeric($rawCode), 'Raw HTTP status code is not numeric - is ' . $rawCode); |
|
169 | 169 | $this->headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] = $value; |
170 | 170 | $this->headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_CODE] = intval($rawCode); |
171 | 171 | } |
@@ -640,7 +640,7 @@ |
||
640 | 640 | ResourceEntityType $concreteType = null |
641 | 641 | ) { |
642 | 642 | $allowedMult = ['*', '1', '0..1']; |
643 | - $backMultArray = [ '*' => '*', '1' => '0..1', '0..1' => '1']; |
|
643 | + $backMultArray = ['*' => '*', '1' => '0..1', '0..1' => '1']; |
|
644 | 644 | $this->checkInstanceProperty($name, $sourceResourceType); |
645 | 645 | |
646 | 646 | // check that property and resource name don't up and collide - would violate OData spec |
@@ -202,7 +202,7 @@ |
||
202 | 202 | $stackDex = count($trackStack) - 1; |
203 | 203 | assert( |
204 | 204 | self::MAX_EXPAND_TREE_DEPTH > $stackDex, |
205 | - 'Expansion stack too deep - should be less than '. self::MAX_EXPAND_TREE_DEPTH . 'elements' |
|
205 | + 'Expansion stack too deep - should be less than ' . self::MAX_EXPAND_TREE_DEPTH . 'elements' |
|
206 | 206 | ); |
207 | 207 | $topNode = $trackStack[$stackDex]; |
208 | 208 | $nodes = $topNode['node']->getChildNodes(); |
@@ -330,8 +330,8 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | $payload = $this->getRequest()->getData(); |
333 | - if($payload instanceof ODataURL){ |
|
334 | -try{ |
|
333 | + if ($payload instanceof ODataURL) { |
|
334 | +try { |
|
335 | 335 | $this->executeGet(); |
336 | 336 | //dd($this->getRequest()->getSegments()[1]); |
337 | 337 | $masterModel = $this->getRequest()->getSegments()[0]->getResult(); |
@@ -353,12 +353,12 @@ discard block |
||
353 | 353 | $slaveModel = $newSegments[0]->getResult(); |
354 | 354 | $slaveResourceSet = $newSegments[0]->getTargetResourceSetWrapper(); |
355 | 355 | $linkAdded = $this->getProviders()->hookSingleModel($masterResourceSet, $masterModel, $slaveResourceSet, $slaveModel, $masterNavProperty); |
356 | - if($linkAdded){ |
|
356 | + if ($linkAdded) { |
|
357 | 357 | $this->getService()->getHost()->setResponseStatusCode(HttpStatus::CODE_NOCONTENT); |
358 | - }else{ |
|
358 | + } else { |
|
359 | 359 | throw ODataException::createInternalServerError("AdapterInidicatedLinkNotAttached"); |
360 | 360 | } |
361 | -}catch(\Exception $e){ |
|
361 | +} catch (\Exception $e) { |
|
362 | 362 | dd($e); |
363 | 363 | } |
364 | 364 | foreach ($segments as $segment) { |
@@ -330,8 +330,8 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | $payload = $this->getRequest()->getData(); |
333 | - if($payload instanceof ODataURL){ |
|
334 | -try{ |
|
333 | + if($payload instanceof ODataURL) { |
|
334 | +try { |
|
335 | 335 | $this->executeGet(); |
336 | 336 | //dd($this->getRequest()->getSegments()[1]); |
337 | 337 | $masterModel = $this->getRequest()->getSegments()[0]->getResult(); |
@@ -353,12 +353,12 @@ discard block |
||
353 | 353 | $slaveModel = $newSegments[0]->getResult(); |
354 | 354 | $slaveResourceSet = $newSegments[0]->getTargetResourceSetWrapper(); |
355 | 355 | $linkAdded = $this->getProviders()->hookSingleModel($masterResourceSet, $masterModel, $slaveResourceSet, $slaveModel, $masterNavProperty); |
356 | - if($linkAdded){ |
|
356 | + if($linkAdded) { |
|
357 | 357 | $this->getService()->getHost()->setResponseStatusCode(HttpStatus::CODE_NOCONTENT); |
358 | - }else{ |
|
358 | + } else { |
|
359 | 359 | throw ODataException::createInternalServerError("AdapterInidicatedLinkNotAttached"); |
360 | 360 | } |
361 | -}catch(\Exception $e){ |
|
361 | +} catch(\Exception $e) { |
|
362 | 362 | dd($e); |
363 | 363 | } |
364 | 364 | foreach ($segments as $segment) { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | if (null === $result->results && HTTPRequestMethod::POST() != $method && HTTPRequestMethod::DELETE() != $method) { |
437 | 437 | throw ODataException::createResourceNotFoundError($request->getIdentifier()); |
438 | 438 | } |
439 | - if(HTTPRequestMethod::POST() != $method && HTTPRequestMethod::DELETE() != $method){ |
|
439 | + if (HTTPRequestMethod::POST() != $method && HTTPRequestMethod::DELETE() != $method) { |
|
440 | 440 | $odataModelInstance = $objectModelSerializer->writeUrlElement($result); |
441 | 441 | } |
442 | 442 | } elseif (TargetKind::RESOURCE() == $requestTargetKind |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | */ |
684 | 684 | protected function compareETag( |
685 | 685 | &$entryObject, |
686 | - ResourceType &$resourceType, |
|
686 | + ResourceType & $resourceType, |
|
687 | 687 | &$needToSerializeResponse |
688 | 688 | ) { |
689 | 689 | $needToSerializeResponse = true; |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | * for use in a URI) there are etag properties, NULL if |
778 | 778 | * there is no etag property |
779 | 779 | */ |
780 | - protected function getETagForEntry(&$entryObject, ResourceType &$resourceType) |
|
780 | + protected function getETagForEntry(&$entryObject, ResourceType & $resourceType) |
|
781 | 781 | { |
782 | 782 | $eTag = null; |
783 | 783 | $comma = null; |
@@ -436,7 +436,7 @@ |
||
436 | 436 | if (null === $result->results && HTTPRequestMethod::POST() != $method && HTTPRequestMethod::DELETE() != $method) { |
437 | 437 | throw ODataException::createResourceNotFoundError($request->getIdentifier()); |
438 | 438 | } |
439 | - if(HTTPRequestMethod::POST() != $method && HTTPRequestMethod::DELETE() != $method){ |
|
439 | + if(HTTPRequestMethod::POST() != $method && HTTPRequestMethod::DELETE() != $method) { |
|
440 | 440 | $odataModelInstance = $objectModelSerializer->writeUrlElement($result); |
441 | 441 | } |
442 | 442 | } elseif (TargetKind::RESOURCE() == $requestTargetKind |