@@ -621,10 +621,10 @@ |
||
| 621 | 621 | { |
| 622 | 622 | $queryParameterString = null; |
| 623 | 623 | foreach ([ODataConstants::HTTPQUERY_STRING_FILTER, |
| 624 | - ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
| 625 | - ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
| 626 | - ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
| 627 | - ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
| 624 | + ODataConstants::HTTPQUERY_STRING_EXPAND, |
|
| 625 | + ODataConstants::HTTPQUERY_STRING_ORDERBY, |
|
| 626 | + ODataConstants::HTTPQUERY_STRING_INLINECOUNT, |
|
| 627 | + ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) { |
|
| 628 | 628 | $value = $this->getService()->getHost()->getQueryStringItem($queryOption); |
| 629 | 629 | if (!is_null($value)) { |
| 630 | 630 | if (!is_null($queryParameterString)) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE' |
| 164 | 164 | ); |
| 165 | 165 | $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed'; |
| 166 | - $propType = 'application/atom+xml;type='.$propTail; |
|
| 166 | + $propType = 'application/atom+xml;type=' . $propTail; |
|
| 167 | 167 | $propName = $prop->getName(); |
| 168 | 168 | $nuLink->title = $propName; |
| 169 | 169 | $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * |
| 204 | 204 | * @return ODataFeed |
| 205 | 205 | */ |
| 206 | - public function writeTopLevelElements(QueryResult &$entryObjects) |
|
| 206 | + public function writeTopLevelElements(QueryResult & $entryObjects) |
|
| 207 | 207 | { |
| 208 | 208 | assert(is_array($entryObjects->results), '!is_array($entryObjects->results)'); |
| 209 | 209 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $resourceSet = $this->getRequest()->getTargetResourceSetWrapper()->getResourceSet(); |
| 241 | 241 | $requestTop = $this->getRequest()->getTopOptionCount(); |
| 242 | 242 | $pageSize = $this->getService()->getConfiguration()->getEntitySetPageSize($resourceSet); |
| 243 | - $requestTop = (null == $requestTop) ? $pageSize + 1 : $requestTop; |
|
| 243 | + $requestTop = (null == $requestTop) ? $pageSize+1 : $requestTop; |
|
| 244 | 244 | |
| 245 | 245 | if (true === $entryObjects->hasMore && $requestTop > $pageSize) { |
| 246 | 246 | $stackSegment = $setName; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | * |
| 328 | 328 | * @return ODataPropertyContent |
| 329 | 329 | */ |
| 330 | - public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType) |
|
| 330 | + public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType) |
|
| 331 | 331 | { |
| 332 | 332 | $result = $complexValue->results; |
| 333 | 333 | |
@@ -356,14 +356,14 @@ discard block |
||
| 356 | 356 | * bag object |
| 357 | 357 | * @return ODataPropertyContent |
| 358 | 358 | */ |
| 359 | - public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType) |
|
| 359 | + public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType) |
|
| 360 | 360 | { |
| 361 | 361 | $result = $BagValue->results; |
| 362 | 362 | |
| 363 | 363 | $propertyContent = new ODataPropertyContent(); |
| 364 | 364 | $odataProperty = new ODataProperty(); |
| 365 | 365 | $odataProperty->name = $propertyName; |
| 366 | - $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')'; |
|
| 366 | + $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')'; |
|
| 367 | 367 | $odataProperty->value = $this->writeBagValue($resourceType, $result); |
| 368 | 368 | |
| 369 | 369 | $propertyContent->properties[] = $odataProperty; |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | * primitive property to be written |
| 380 | 380 | * @return ODataPropertyContent |
| 381 | 381 | */ |
| 382 | - public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null) |
|
| 382 | + public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null) |
|
| 383 | 383 | { |
| 384 | 384 | assert(null != $resourceProperty, "Resource property must not be null"); |
| 385 | 385 | $propertyContent = new ODataPropertyContent(); |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | $segmentWrappers = $this->getStack()->getSegmentWrappers(); |
| 630 | 630 | $count = count($segmentWrappers); |
| 631 | 631 | |
| 632 | - return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count - 1]; |
|
| 632 | + return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1]; |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | /** |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | $skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject); |
| 655 | 655 | assert(!is_null($skipToken), '!is_null($skipToken)'); |
| 656 | 656 | $token = (1 < $numSegments) ? '$skiptoken=' : '$skip='; |
| 657 | - $skipToken = '?'.$queryParameterString.$token.$skipToken; |
|
| 657 | + $skipToken = '?' . $queryParameterString . $token . $skipToken; |
|
| 658 | 658 | |
| 659 | 659 | return $skipToken; |
| 660 | 660 | } |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | |
| 689 | 689 | $topCountValue = $this->getRequest()->getTopOptionCount(); |
| 690 | 690 | if (!is_null($topCountValue)) { |
| 691 | - $remainingCount = $topCountValue - $this->getRequest()->getTopCount(); |
|
| 691 | + $remainingCount = $topCountValue-$this->getRequest()->getTopCount(); |
|
| 692 | 692 | if (0 < $remainingCount) { |
| 693 | 693 | if (!is_null($queryParameterString)) { |
| 694 | 694 | $queryParameterString .= '&'; |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | * |
| 724 | 724 | * @return string |
| 725 | 725 | */ |
| 726 | - private function primitiveToString(IType &$type, $primitiveValue) |
|
| 726 | + private function primitiveToString(IType & $type, $primitiveValue) |
|
| 727 | 727 | { |
| 728 | 728 | if ($type instanceof Boolean) { |
| 729 | 729 | $stringValue = (true === $primitiveValue) ? 'true' : 'false'; |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | * @param $result |
| 818 | 818 | * @return ODataBagContent |
| 819 | 819 | */ |
| 820 | - protected function writeBagValue(ResourceType &$resourceType, $result) |
|
| 820 | + protected function writeBagValue(ResourceType & $resourceType, $result) |
|
| 821 | 821 | { |
| 822 | 822 | assert(null == $result || is_array($result), 'Bag parameter must be null or array'); |
| 823 | 823 | $typeKind = $resourceType->getResourceTypeKind(); |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | * @param string $propertyName |
| 851 | 851 | * @return ODataPropertyContent |
| 852 | 852 | */ |
| 853 | - protected function writeComplexValue(ResourceType &$resourceType, &$result, $propertyName = null) |
|
| 853 | + protected function writeComplexValue(ResourceType & $resourceType, &$result, $propertyName = null) |
|
| 854 | 854 | { |
| 855 | 855 | assert(is_object($result), 'Supplied $customObject must be an object'); |
| 856 | 856 | |
@@ -35,29 +35,29 @@ discard block |
||
| 35 | 35 | assert(0 < count($this->mapping), "Mapping array must not be empty"); |
| 36 | 36 | |
| 37 | 37 | if (!array_key_exists($modelName, $this->mapping)) { |
| 38 | - throw new \Exception('Metadata mapping for model '.$modelName.' not defined'); |
|
| 38 | + throw new \Exception('Metadata mapping for model ' . $modelName . ' not defined'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | if (!in_array(strtolower($crudVerb), $this->crudVerbs)) { |
| 42 | - throw new \Exception('CRUD verb '.$crudVerb.' not defined'); |
|
| 42 | + throw new \Exception('CRUD verb ' . $crudVerb . ' not defined'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $lookup = $this->mapping[$modelName]; |
| 46 | 46 | if (!is_array($lookup)) { |
| 47 | - throw new \Exception('Metadata mapping for model '.$modelName.' not an array'); |
|
| 47 | + throw new \Exception('Metadata mapping for model ' . $modelName . ' not an array'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if (!array_key_exists($crudVerb, $lookup)) { |
| 51 | - throw new \Exception('Metadata mapping for CRUD verb '.$crudVerb.' on model '.$modelName.' not defined'); |
|
| 51 | + throw new \Exception('Metadata mapping for CRUD verb ' . $crudVerb . ' on model ' . $modelName . ' not defined'); |
|
| 52 | 52 | } |
| 53 | 53 | $result = $lookup[$crudVerb]; |
| 54 | 54 | if (!isset($result)) { |
| 55 | - throw new \Exception('Metadata mapping for CRUD verb '.$crudVerb.' on model '.$modelName.' null'); |
|
| 55 | + throw new \Exception('Metadata mapping for CRUD verb ' . $crudVerb . ' on model ' . $modelName . ' null'); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if (!method_exists($this, $result)) { |
| 59 | 59 | throw new \Exception( |
| 60 | - 'Metadata target for CRUD verb '.$crudVerb.' on model '.$modelName.' does not exist' |
|
| 60 | + 'Metadata target for CRUD verb ' . $crudVerb . ' on model ' . $modelName . ' does not exist' |
|
| 61 | 61 | ); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -79,19 +79,19 @@ discard block |
||
| 79 | 79 | // check that mapping array is well formed and sane, rather than waiting to stab us with a spatula |
| 80 | 80 | foreach ($this->mapping as $key => $map) { |
| 81 | 81 | if (!is_array($map)) { |
| 82 | - throw new \Exception('Metadata mapping for model '.$key.' not an array'); |
|
| 82 | + throw new \Exception('Metadata mapping for model ' . $key . ' not an array'); |
|
| 83 | 83 | } |
| 84 | 84 | foreach ($map as $verb => $method) { |
| 85 | 85 | if (!in_array(strtolower($verb), $this->crudVerbs)) { |
| 86 | - throw new \Exception('CRUD verb '.$verb.' not defined'); |
|
| 86 | + throw new \Exception('CRUD verb ' . $verb . ' not defined'); |
|
| 87 | 87 | } |
| 88 | 88 | if (!isset($method)) { |
| 89 | - throw new \Exception('Metadata mapping for CRUD verb '.$verb.' on model '.$key.' null'); |
|
| 89 | + throw new \Exception('Metadata mapping for CRUD verb ' . $verb . ' on model ' . $key . ' null'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if (!method_exists($this, $method)) { |
| 93 | 93 | throw new \Exception( |
| 94 | - 'Metadata target for CRUD verb '.$verb.' on model '.$key.' does not exist' |
|
| 94 | + 'Metadata target for CRUD verb ' . $verb . ' on model ' . $key . ' does not exist' |
|
| 95 | 95 | ); |
| 96 | 96 | } |
| 97 | 97 | $parmArray = $this->getParameterNames($method); |
@@ -58,9 +58,9 @@ |
||
| 58 | 58 | $cerealRequest = serialize($request); |
| 59 | 59 | $cerealMeta = serialize($meta); |
| 60 | 60 | $cerealResponse = serialize($odataResponse); |
| 61 | - Storage::put($xTest.'request', $cerealRequest); |
|
| 62 | - Storage::put($xTest.'metadata', $cerealMeta); |
|
| 63 | - Storage::put($xTest.'response', $cerealResponse); |
|
| 61 | + Storage::put($xTest . 'request', $cerealRequest); |
|
| 62 | + Storage::put($xTest . 'metadata', $cerealMeta); |
|
| 63 | + Storage::put($xTest . 'response', $cerealResponse); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | class MetadataProvider extends MetadataBaseProvider |
| 15 | 15 | { |
| 16 | - protected $multConstraints = [ '0..1' => ['1'], '1' => ['0..1', '*'], '*' => ['1', '*']]; |
|
| 16 | + protected $multConstraints = ['0..1' => ['1'], '1' => ['0..1', '*'], '*' => ['1', '*']]; |
|
| 17 | 17 | protected static $METANAMESPACE = "Data"; |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | foreach ($lock as $barrel => $roll) { |
| 54 | 54 | assert( |
| 55 | 55 | !array_key_exists($barrel, $metamix[$key]), |
| 56 | - 'Mapping already defined for model '.$key.' and CRUD verb '.$barrel |
|
| 56 | + 'Mapping already defined for model ' . $key . ' and CRUD verb ' . $barrel |
|
| 57 | 57 | ); |
| 58 | 58 | $metamix[$key][$barrel] = $roll; |
| 59 | 59 | } |
@@ -293,12 +293,12 @@ discard block |
||
| 293 | 293 | 'morphToMany', |
| 294 | 294 | 'morphedByMany' |
| 295 | 295 | ] as $relation) { |
| 296 | - $search = '$this->'.$relation.'('; |
|
| 296 | + $search = '$this->' . $relation . '('; |
|
| 297 | 297 | if ($pos = stripos($code, $search)) { |
| 298 | 298 | //Resolve the relation's model to a Relation object. |
| 299 | 299 | $relationObj = $model->$method(); |
| 300 | 300 | if ($relationObj instanceof Relation) { |
| 301 | - $relatedModel = '\\'.get_class($relationObj->getRelated()); |
|
| 301 | + $relatedModel = '\\' . get_class($relationObj->getRelated()); |
|
| 302 | 302 | $relations = [ |
| 303 | 303 | 'hasManyThrough', |
| 304 | 304 | 'belongsToMany', |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | break; |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | - assert(in_array($fkMethodName, $methodList), "Selected method, ".$fkMethodName.", not in method list"); |
|
| 445 | + assert(in_array($fkMethodName, $methodList), "Selected method, " . $fkMethodName . ", not in method list"); |
|
| 446 | 446 | $rkMethodName = 'getQualifiedRelatedPivotKeyName'; |
| 447 | 447 | foreach ($rkList as $option) { |
| 448 | 448 | if (in_array($option, $methodList)) { |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | break; |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | - assert(in_array($rkMethodName, $methodList), "Selected method, ".$rkMethodName.", not in method list"); |
|
| 453 | + assert(in_array($rkMethodName, $methodList), "Selected method, " . $rkMethodName . ", not in method list"); |
|
| 454 | 454 | $line = ['fk' => $fkMethodName, 'rk' => $rkMethodName]; |
| 455 | 455 | static::$methodPrimary[get_class($foo)] = $line; |
| 456 | 456 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | break; |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | - assert(in_array($fkMethodName, $methodList), "Selected method, ".$fkMethodName.", not in method list"); |
|
| 482 | + assert(in_array($fkMethodName, $methodList), "Selected method, " . $fkMethodName . ", not in method list"); |
|
| 483 | 483 | $rkMethodName = 'getQualifiedParentKeyName'; |
| 484 | 484 | foreach ($rkList as $option) { |
| 485 | 485 | if (in_array($option, $methodList)) { |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | break; |
| 488 | 488 | } |
| 489 | 489 | } |
| 490 | - assert(in_array($rkMethodName, $methodList), "Selected method, ".$rkMethodName.", not in method list"); |
|
| 490 | + assert(in_array($rkMethodName, $methodList), "Selected method, " . $rkMethodName . ", not in method list"); |
|
| 491 | 491 | $line = ['fk' => $fkMethodName, 'rk' => $rkMethodName]; |
| 492 | 492 | static::$methodAlternate[get_class($foo)] = $line; |
| 493 | 493 | } |
@@ -534,10 +534,10 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | $keyRaw = $isBelong ? $foo->$fkMethodName() : $foo->$fkMethodAlternate(); |
| 536 | 536 | $keySegments = explode('.', $keyRaw); |
| 537 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
| 537 | + $keyName = $keySegments[count($keySegments)-1]; |
|
| 538 | 538 | $localRaw = $isBelong ? $foo->$rkMethodName() : $foo->$rkMethodAlternate(); |
| 539 | 539 | $localSegments = explode('.', $localRaw); |
| 540 | - $localName = $localSegments[count($localSegments) - 1]; |
|
| 540 | + $localName = $localSegments[count($localSegments)-1]; |
|
| 541 | 541 | $first = $keyName; |
| 542 | 542 | $last = $localName; |
| 543 | 543 | $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ); |
@@ -563,10 +563,10 @@ discard block |
||
| 563 | 563 | |
| 564 | 564 | $keyName = $isBelong ? $foo->$fkMethodName() : $foo->$fkMethodAlternate(); |
| 565 | 565 | $keySegments = explode('.', $keyName); |
| 566 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
| 566 | + $keyName = $keySegments[count($keySegments)-1]; |
|
| 567 | 567 | $localRaw = $isBelong ? $foo->$rkMethodName() : $foo->$rkMethodAlternate(); |
| 568 | 568 | $localSegments = explode('.', $localRaw); |
| 569 | - $localName = $localSegments[count($localSegments) - 1]; |
|
| 569 | + $localName = $localSegments[count($localSegments)-1]; |
|
| 570 | 570 | $first = $isBelong ? $localName : $keyName; |
| 571 | 571 | $last = $isBelong ? $keyName : $localName; |
| 572 | 572 | $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ); |
@@ -590,10 +590,10 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | $keyRaw = $isMany ? $foo->$fkMethodName() : $foo->$fkMethodAlternate(); |
| 592 | 592 | $keySegments = explode('.', $keyRaw); |
| 593 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
| 593 | + $keyName = $keySegments[count($keySegments)-1]; |
|
| 594 | 594 | $localRaw = $isMany ? $foo->$rkMethodName() : $foo->$rkMethodAlternate(); |
| 595 | 595 | $localSegments = explode('.', $localRaw); |
| 596 | - $localName = $localSegments[count($localSegments) - 1]; |
|
| 596 | + $localName = $localSegments[count($localSegments)-1]; |
|
| 597 | 597 | $first = $isMany ? $keyName : $localName; |
| 598 | 598 | $last = $isMany ? $localName : $keyName; |
| 599 | 599 | $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ); |
@@ -616,10 +616,10 @@ discard block |
||
| 616 | 616 | |
| 617 | 617 | $keyRaw = $isMany ? $foo->$fkMethodName() : $foo->$fkMethodAlternate(); |
| 618 | 618 | $keySegments = explode('.', $keyRaw); |
| 619 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
| 619 | + $keyName = $keySegments[count($keySegments)-1]; |
|
| 620 | 620 | $localRaw = $isMany ? $foo->$rkMethodName() : $foo->$rkMethodAlternate(); |
| 621 | 621 | $localSegments = explode('.', $localRaw); |
| 622 | - $localName = $localSegments[count($localSegments) - 1]; |
|
| 622 | + $localName = $localSegments[count($localSegments)-1]; |
|
| 623 | 623 | |
| 624 | 624 | $first = $keyName; |
| 625 | 625 | $last = (isset($localName) && "" != $localName) ? $localName : $foo->getRelated()->getKeyName(); |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | $nullFilter = true; |
| 136 | 136 | $isvalid = null; |
| 137 | 137 | if (isset($filterInfo)) { |
| 138 | - $method = "return ".$filterInfo->getExpressionAsString().";"; |
|
| 139 | - $clln = "$".$resourceSet->getResourceType()->getName(); |
|
| 138 | + $method = "return " . $filterInfo->getExpressionAsString() . ";"; |
|
| 139 | + $clln = "$" . $resourceSet->getResourceType()->getName(); |
|
| 140 | 140 | $isvalid = create_function($clln, $method); |
| 141 | 141 | $nullFilter = false; |
| 142 | 142 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | // so we can't bail out early |
| 165 | 165 | $rawCount += $results->count(); |
| 166 | 166 | // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz |
| 167 | - if ($rawTop > $resultSet->count() + $skip) { |
|
| 167 | + if ($rawTop > $resultSet->count()+$skip) { |
|
| 168 | 168 | $resultSet = collect(array_merge($resultSet->all(), $results->all())); |
| 169 | 169 | $sliceAmount = min($skip, $resultSet->count()); |
| 170 | 170 | $resultSet = $resultSet->slice($sliceAmount); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | if (QueryType::COUNT() == $queryType || QueryType::ENTITIES_WITH_COUNT() == $queryType) { |
| 203 | 203 | $result->count = $resultCount; |
| 204 | 204 | } |
| 205 | - $hazMore = $bulkSetCount > $skip + count($resultSet); |
|
| 205 | + $hazMore = $bulkSetCount > $skip+count($resultSet); |
|
| 206 | 206 | $result->hasMore = $hazMore; |
| 207 | 207 | return $result; |
| 208 | 208 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | $propertyName = $targetProperty->getName(); |
| 367 | 367 | if (!method_exists($sourceEntityInstance, $propertyName)) { |
| 368 | - $msg = 'Relation method, '.$propertyName.', does not exist on supplied entity.'; |
|
| 368 | + $msg = 'Relation method, ' . $propertyName . ', does not exist on supplied entity.'; |
|
| 369 | 369 | throw new InvalidArgumentException($msg); |
| 370 | 370 | } |
| 371 | 371 | // take key descriptor and turn it into where clause here, rather than in getResource call |
@@ -83,34 +83,34 @@ discard block |
||
| 83 | 83 | return "(strpos($params[1], $params[0]) !== false)"; |
| 84 | 84 | }; |
| 85 | 85 | $this->functionDescriptionParsers[ODataConstants::STRFUN_CONCAT] = function ($params) { |
| 86 | - return $params[0].' . '.$params[1]; |
|
| 86 | + return $params[0] . ' . ' . $params[1]; |
|
| 87 | 87 | }; |
| 88 | 88 | $this->functionDescriptionParsers[ODataConstants::STRFUN_LENGTH] = function ($params) { |
| 89 | 89 | return "strlen($params[0])"; |
| 90 | 90 | }; |
| 91 | 91 | $this->functionDescriptionParsers[ODataConstants::GUIDFUN_EQUAL] = function ($params) { |
| 92 | - return self::TYPE_NAMESPACE."Guid::guidEqual($params[0], $params[1])"; |
|
| 92 | + return self::TYPE_NAMESPACE . "Guid::guidEqual($params[0], $params[1])"; |
|
| 93 | 93 | }; |
| 94 | 94 | $this->functionDescriptionParsers[ODataConstants::DATETIME_COMPARE] = function ($params) { |
| 95 | - return self::TYPE_NAMESPACE."DateTime::dateTimeCmp($params[0], $params[1])"; |
|
| 95 | + return self::TYPE_NAMESPACE . "DateTime::dateTimeCmp($params[0], $params[1])"; |
|
| 96 | 96 | }; |
| 97 | 97 | $this->functionDescriptionParsers[ODataConstants::DATETIME_YEAR] = function ($params) { |
| 98 | - return self::TYPE_NAMESPACE."DateTime::year($params[0])"; |
|
| 98 | + return self::TYPE_NAMESPACE . "DateTime::year($params[0])"; |
|
| 99 | 99 | }; |
| 100 | 100 | $this->functionDescriptionParsers[ODataConstants::DATETIME_MONTH] = function ($params) { |
| 101 | - return self::TYPE_NAMESPACE."DateTime::month($params[0])"; |
|
| 101 | + return self::TYPE_NAMESPACE . "DateTime::month($params[0])"; |
|
| 102 | 102 | }; |
| 103 | 103 | $this->functionDescriptionParsers[ODataConstants::DATETIME_DAY] = function ($params) { |
| 104 | - return self::TYPE_NAMESPACE."DateTime::day($params[0])"; |
|
| 104 | + return self::TYPE_NAMESPACE . "DateTime::day($params[0])"; |
|
| 105 | 105 | }; |
| 106 | 106 | $this->functionDescriptionParsers[ODataConstants::DATETIME_HOUR] = function ($params) { |
| 107 | - return self::TYPE_NAMESPACE."DateTime::hour($params[0])"; |
|
| 107 | + return self::TYPE_NAMESPACE . "DateTime::hour($params[0])"; |
|
| 108 | 108 | }; |
| 109 | 109 | $this->functionDescriptionParsers[ODataConstants::DATETIME_MINUTE] = function ($params) { |
| 110 | - return self::TYPE_NAMESPACE."DateTime::minute($params[0])"; |
|
| 110 | + return self::TYPE_NAMESPACE . "DateTime::minute($params[0])"; |
|
| 111 | 111 | }; |
| 112 | 112 | $this->functionDescriptionParsers[ODataConstants::DATETIME_SECOND] = function ($params) { |
| 113 | - return self::TYPE_NAMESPACE."DateTime::second($params[0])"; |
|
| 113 | + return self::TYPE_NAMESPACE . "DateTime::second($params[0])"; |
|
| 114 | 114 | }; |
| 115 | 115 | $this->functionDescriptionParsers[ODataConstants::MATHFUN_ROUND] = function ($params) { |
| 116 | 116 | return "round($params[0])"; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return "floor($params[0])"; |
| 123 | 123 | }; |
| 124 | 124 | $this->functionDescriptionParsers[ODataConstants::BINFUL_EQUAL] = function ($params) { |
| 125 | - return self::TYPE_NAMESPACE."Binary::binaryEqual($params[0], $params[1])"; |
|
| 125 | + return self::TYPE_NAMESPACE . "Binary::binaryEqual($params[0], $params[1])"; |
|
| 126 | 126 | }; |
| 127 | 127 | $this->functionDescriptionParsers['is_null'] = function ($params) { |
| 128 | 128 | return "is_null($params[0])"; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function setResourceType(ResourceType $resourceType) |
| 158 | 158 | { |
| 159 | - $this->iteratorName = "$".$resourceType->getName(); |
|
| 159 | + $this->iteratorName = "$" . $resourceType->getName(); |
|
| 160 | 160 | $this->resourceType = $resourceType; |
| 161 | 161 | } |
| 162 | 162 | /** |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | $parent = $expression; |
| 282 | 282 | $variable = null; |
| 283 | 283 | do { |
| 284 | - $variable = $parent->getResourceProperty()->getName().self::MEMBER_ACCESS.$variable; |
|
| 284 | + $variable = $parent->getResourceProperty()->getName() . self::MEMBER_ACCESS . $variable; |
|
| 285 | 285 | $parent = $parent->getParent(); |
| 286 | 286 | } while ($parent != null); |
| 287 | 287 | $variable = rtrim($variable, self::MEMBER_ACCESS); |
| 288 | - $variable = $this->getIteratorName().self::MEMBER_ACCESS.$variable; |
|
| 288 | + $variable = $this->getIteratorName() . self::MEMBER_ACCESS . $variable; |
|
| 289 | 289 | return $variable; |
| 290 | 290 | } |
| 291 | 291 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | private function _prepareBinaryExpression($operator, $left, $right) |
| 319 | 319 | { |
| 320 | 320 | return |
| 321 | - self::OPEN_BRACKET.$left.' '.$operator.' '.$right.self::CLOSE_BRACKET; |
|
| 321 | + self::OPEN_BRACKET . $left . ' ' . $operator . ' ' . $right . self::CLOSE_BRACKET; |
|
| 322 | 322 | } |
| 323 | 323 | /** |
| 324 | 324 | * To format unary expression. |
@@ -330,6 +330,6 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | private function _prepareUnaryExpression($operator, $child) |
| 332 | 332 | { |
| 333 | - return $operator.self::OPEN_BRACKET.$child.self::CLOSE_BRACKET; |
|
| 333 | + return $operator . self::OPEN_BRACKET . $child . self::CLOSE_BRACKET; |
|
| 334 | 334 | } |
| 335 | 335 | } |
@@ -310,12 +310,12 @@ discard block |
||
| 310 | 310 | $map = $raw->getMetadata(); |
| 311 | 311 | |
| 312 | 312 | if (!array_key_exists($class, $map)) { |
| 313 | - throw new \POData\Common\InvalidOperationException('Controller mapping missing for class '.$class.'.'); |
|
| 313 | + throw new \POData\Common\InvalidOperationException('Controller mapping missing for class ' . $class . '.'); |
|
| 314 | 314 | } |
| 315 | 315 | $goal = $raw->getMapping($class, $verb); |
| 316 | 316 | if (null == $goal) { |
| 317 | 317 | throw new \POData\Common\InvalidOperationException( |
| 318 | - 'Controller mapping missing for '.$verb.' verb on class '.$class.'.' |
|
| 318 | + 'Controller mapping missing for ' . $verb . ' verb on class ' . $class . '.' |
|
| 319 | 319 | ); |
| 320 | 320 | } |
| 321 | 321 | |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | throw new ODataException($e->getMessage(), 500); |
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | - throw new ODataException('Target model not successfully '.$lastWord, 422); |
|
| 394 | + throw new ODataException('Target model not successfully ' . $lastWord, 422); |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | } |
| 435 | 435 | $outData = $result->getData(); |
| 436 | 436 | if (is_object($outData)) { |
| 437 | - $outData = (array)$outData; |
|
| 437 | + $outData = (array) $outData; |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | if (!is_array($outData)) { |