@@ -79,7 +79,7 @@ |
||
| 79 | 79 | */ |
| 80 | 80 | public function register() |
| 81 | 81 | { |
| 82 | - $this->app->singleton('metadataControllers', function ($app) { |
|
| 82 | + $this->app->singleton('metadataControllers', function($app) { |
|
| 83 | 83 | return new MetadataControllerContainer(); |
| 84 | 84 | }); |
| 85 | 85 | } |
@@ -3,9 +3,7 @@ |
||
| 3 | 3 | namespace AlgoWeb\PODataLaravel\Providers; |
| 4 | 4 | |
| 5 | 5 | use AlgoWeb\PODataLaravel\Controllers\MetadataControllerTrait; |
| 6 | -use AlgoWeb\PODataLaravel\Controllers\TestController; |
|
| 7 | 6 | use Illuminate\Routing\Controller; |
| 8 | -use Illuminate\Support\ServiceProvider; |
|
| 9 | 7 | use Illuminate\Support\Facades\Cache; |
| 10 | 8 | use AlgoWeb\PODataLaravel\Controllers\MetadataControllerContainer; |
| 11 | 9 | use Illuminate\Support\Facades\App; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function register() |
| 26 | 26 | { |
| 27 | - $this->app->singleton('odataquery', function ($app) { |
|
| 27 | + $this->app->singleton('odataquery', function($app) { |
|
| 28 | 28 | return new LaravelQuery(); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | /** |
| 317 | 317 | * Delete resource from a resource set. |
| 318 | - * @param ResourceSet|null $sourceResourceSet |
|
| 318 | + * @param ResourceSet $sourceResourceSet |
|
| 319 | 319 | * @param object $sourceEntityInstance |
| 320 | 320 | * |
| 321 | 321 | * return bool true if resources sucessfully deteled, otherwise false. |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | * @param ResourceSet $sourceResourceSet |
| 461 | 461 | * @param $sourceEntityInstance |
| 462 | 462 | * @param $data |
| 463 | - * @param $verb |
|
| 463 | + * @param string $verb |
|
| 464 | 464 | * @return mixed |
| 465 | 465 | * @throws ODataException |
| 466 | 466 | * @throws \POData\Common\InvalidOperationException |
@@ -490,7 +490,7 @@ |
||
| 490 | 490 | } |
| 491 | 491 | $outData = $result->getData(); |
| 492 | 492 | if (is_object($outData)) { |
| 493 | - $outData = (array)$outData; |
|
| 493 | + $outData = (array) $outData; |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | if (!is_array($outData)) { |
@@ -414,8 +414,8 @@ |
||
| 414 | 414 | * @param $first |
| 415 | 415 | * @param $property |
| 416 | 416 | * @param $last |
| 417 | - * @param $mult |
|
| 418 | - * @param $targ |
|
| 417 | + * @param string $mult |
|
| 418 | + * @param string $targ |
|
| 419 | 419 | */ |
| 420 | 420 | private function addRelationsHook(&$hooks, $first, $property, $last, $mult, $targ) |
| 421 | 421 | { |
@@ -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(); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | class MetadataProvider extends MetadataBaseProvider |
| 14 | 14 | { |
| 15 | - protected $multConstraints = [ '0..1' => ['1'], '1' => ['0..1', '*'], '*' => ['1', '*']]; |
|
| 15 | + protected $multConstraints = ['0..1' => ['1'], '1' => ['0..1', '*'], '*' => ['1', '*']]; |
|
| 16 | 16 | protected static $METANAMESPACE = "Data"; |
| 17 | 17 | |
| 18 | 18 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function register() |
| 77 | 77 | { |
| 78 | - $this->app->singleton('metadata', function ($app) { |
|
| 78 | + $this->app->singleton('metadata', function($app) { |
|
| 79 | 79 | return new SimpleMetadataProvider('Data', self::$METANAMESPACE); |
| 80 | 80 | }); |
| 81 | 81 | } |
@@ -196,11 +196,11 @@ discard block |
||
| 196 | 196 | $dependentProperty = $foreign[$dependentType]['property']; |
| 197 | 197 | assert( |
| 198 | 198 | in_array($dependentMult, $this->multConstraints[$principalMult]), |
| 199 | - "Cannot pair multiplicities " . $dependentMult . " and " . $principalMult |
|
| 199 | + "Cannot pair multiplicities ".$dependentMult." and ".$principalMult |
|
| 200 | 200 | ); |
| 201 | 201 | assert( |
| 202 | 202 | in_array($principalMult, $this->multConstraints[$dependentMult]), |
| 203 | - "Cannot pair multiplicities " . $principalMult . " and " . $dependentMult |
|
| 203 | + "Cannot pair multiplicities ".$principalMult." and ".$dependentMult |
|
| 204 | 204 | ); |
| 205 | 205 | // generate forward and reverse relations |
| 206 | 206 | list($forward, $reverse) = $this->calculateRoundTripRelationsGenForwardReverse( |
@@ -244,11 +244,11 @@ discard block |
||
| 244 | 244 | $dependentProperty = $foreign['property']; |
| 245 | 245 | assert( |
| 246 | 246 | in_array($dependentMult, $this->multConstraints[$principalMult]), |
| 247 | - "Cannot pair multiplicities " . $dependentMult . " and " . $principalMult |
|
| 247 | + "Cannot pair multiplicities ".$dependentMult." and ".$principalMult |
|
| 248 | 248 | ); |
| 249 | 249 | assert( |
| 250 | 250 | in_array($principalMult, $this->multConstraints[$dependentMult]), |
| 251 | - "Cannot pair multiplicities " . $principalMult . " and " . $dependentMult |
|
| 251 | + "Cannot pair multiplicities ".$principalMult." and ".$dependentMult |
|
| 252 | 252 | ); |
| 253 | 253 | // generate forward and reverse relations |
| 254 | 254 | list($forward, $reverse) = $this->calculateRoundTripRelationsGenForwardReverse( |
@@ -3,12 +3,9 @@ |
||
| 3 | 3 | namespace AlgoWeb\PODataLaravel\Providers; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Support\Facades\App; |
| 6 | -use Illuminate\Support\ServiceProvider; |
|
| 7 | 6 | use Illuminate\Support\Facades\Cache; |
| 8 | 7 | use POData\Providers\Metadata\IMetadataProvider; |
| 9 | -use POData\Providers\Metadata\ResourceType; |
|
| 10 | 8 | use POData\Providers\Metadata\SimpleMetadataProvider; |
| 11 | -use Illuminate\Support\Facades\Route; |
|
| 12 | 9 | use Illuminate\Support\Facades\Schema as Schema; |
| 13 | 10 | |
| 14 | 11 | class MetadataProvider extends MetadataBaseProvider |
@@ -51,80 +51,80 @@ |
||
| 51 | 51 | */ |
| 52 | 52 | public function __construct() |
| 53 | 53 | { |
| 54 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_COMPARE] = function ($params) { |
|
| 54 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_COMPARE] = function($params) { |
|
| 55 | 55 | return "strcmp($params[0], $params[1])"; |
| 56 | 56 | }; |
| 57 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_ENDSWITH] = function ($params) { |
|
| 57 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_ENDSWITH] = function($params) { |
|
| 58 | 58 | return "(strcmp(substr($params[0], strlen($params[0]) - strlen($params[1])), $params[1]) === 0)"; |
| 59 | 59 | }; |
| 60 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_INDEXOF] = function ($params) { |
|
| 60 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_INDEXOF] = function($params) { |
|
| 61 | 61 | return "strpos($params[0], $params[1])"; |
| 62 | 62 | }; |
| 63 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_REPLACE] = function ($params) { |
|
| 63 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_REPLACE] = function($params) { |
|
| 64 | 64 | return "str_replace($params[1], $params[2], $params[0])"; |
| 65 | 65 | }; |
| 66 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_STARTSWITH] = function ($params) { |
|
| 66 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_STARTSWITH] = function($params) { |
|
| 67 | 67 | return "(strpos($params[0], $params[1]) === 0)"; |
| 68 | 68 | }; |
| 69 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_TOLOWER] = function ($params) { |
|
| 69 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_TOLOWER] = function($params) { |
|
| 70 | 70 | return "strtolower($params[0])"; |
| 71 | 71 | }; |
| 72 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_TOUPPER] = function ($params) { |
|
| 72 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_TOUPPER] = function($params) { |
|
| 73 | 73 | return "strtoupper($params[0])"; |
| 74 | 74 | }; |
| 75 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_TRIM] = function ($params) { |
|
| 75 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_TRIM] = function($params) { |
|
| 76 | 76 | return "trim($params[0])"; |
| 77 | 77 | }; |
| 78 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRING] = function ($params) { |
|
| 78 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRING] = function($params) { |
|
| 79 | 79 | return count($params) == 3 ? |
| 80 | 80 | "substr($params[0], $params[1], $params[2])" : "substr($params[0], $params[1])"; |
| 81 | 81 | }; |
| 82 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRINGOF] = function ($params) { |
|
| 82 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_SUBSTRINGOF] = function($params) { |
|
| 83 | 83 | return "(strpos($params[1], $params[0]) !== false)"; |
| 84 | 84 | }; |
| 85 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_CONCAT] = function ($params) { |
|
| 85 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_CONCAT] = function($params) { |
|
| 86 | 86 | return $params[0].' . '.$params[1]; |
| 87 | 87 | }; |
| 88 | - $this->functionDescriptionParsers[ODataConstants::STRFUN_LENGTH] = function ($params) { |
|
| 88 | + $this->functionDescriptionParsers[ODataConstants::STRFUN_LENGTH] = function($params) { |
|
| 89 | 89 | return "strlen($params[0])"; |
| 90 | 90 | }; |
| 91 | - $this->functionDescriptionParsers[ODataConstants::GUIDFUN_EQUAL] = function ($params) { |
|
| 91 | + $this->functionDescriptionParsers[ODataConstants::GUIDFUN_EQUAL] = function($params) { |
|
| 92 | 92 | return self::TYPE_NAMESPACE."Guid::guidEqual($params[0], $params[1])"; |
| 93 | 93 | }; |
| 94 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_COMPARE] = function ($params) { |
|
| 94 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_COMPARE] = function($params) { |
|
| 95 | 95 | return self::TYPE_NAMESPACE."DateTime::dateTimeCmp($params[0], $params[1])"; |
| 96 | 96 | }; |
| 97 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_YEAR] = function ($params) { |
|
| 97 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_YEAR] = function($params) { |
|
| 98 | 98 | return self::TYPE_NAMESPACE."DateTime::year($params[0])"; |
| 99 | 99 | }; |
| 100 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_MONTH] = function ($params) { |
|
| 100 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_MONTH] = function($params) { |
|
| 101 | 101 | return self::TYPE_NAMESPACE."DateTime::month($params[0])"; |
| 102 | 102 | }; |
| 103 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_DAY] = function ($params) { |
|
| 103 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_DAY] = function($params) { |
|
| 104 | 104 | return self::TYPE_NAMESPACE."DateTime::day($params[0])"; |
| 105 | 105 | }; |
| 106 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_HOUR] = function ($params) { |
|
| 106 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_HOUR] = function($params) { |
|
| 107 | 107 | return self::TYPE_NAMESPACE."DateTime::hour($params[0])"; |
| 108 | 108 | }; |
| 109 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_MINUTE] = function ($params) { |
|
| 109 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_MINUTE] = function($params) { |
|
| 110 | 110 | return self::TYPE_NAMESPACE."DateTime::minute($params[0])"; |
| 111 | 111 | }; |
| 112 | - $this->functionDescriptionParsers[ODataConstants::DATETIME_SECOND] = function ($params) { |
|
| 112 | + $this->functionDescriptionParsers[ODataConstants::DATETIME_SECOND] = function($params) { |
|
| 113 | 113 | return self::TYPE_NAMESPACE."DateTime::second($params[0])"; |
| 114 | 114 | }; |
| 115 | - $this->functionDescriptionParsers[ODataConstants::MATHFUN_ROUND] = function ($params) { |
|
| 115 | + $this->functionDescriptionParsers[ODataConstants::MATHFUN_ROUND] = function($params) { |
|
| 116 | 116 | return "round($params[0])"; |
| 117 | 117 | }; |
| 118 | - $this->functionDescriptionParsers[ODataConstants::MATHFUN_CEILING] = function ($params) { |
|
| 118 | + $this->functionDescriptionParsers[ODataConstants::MATHFUN_CEILING] = function($params) { |
|
| 119 | 119 | return "ceil($params[0])"; |
| 120 | 120 | }; |
| 121 | - $this->functionDescriptionParsers[ODataConstants::MATHFUN_FLOOR] = function ($params) { |
|
| 121 | + $this->functionDescriptionParsers[ODataConstants::MATHFUN_FLOOR] = function($params) { |
|
| 122 | 122 | return "floor($params[0])"; |
| 123 | 123 | }; |
| 124 | - $this->functionDescriptionParsers[ODataConstants::BINFUL_EQUAL] = function ($params) { |
|
| 124 | + $this->functionDescriptionParsers[ODataConstants::BINFUL_EQUAL] = function($params) { |
|
| 125 | 125 | return self::TYPE_NAMESPACE."Binary::binaryEqual($params[0], $params[1])"; |
| 126 | 126 | }; |
| 127 | - $this->functionDescriptionParsers['is_null'] = function ($params) { |
|
| 127 | + $this->functionDescriptionParsers['is_null'] = function($params) { |
|
| 128 | 128 | return "is_null($params[0])"; |
| 129 | 129 | }; |
| 130 | 130 | } |
@@ -346,6 +346,7 @@ |
||
| 346 | 346 | |
| 347 | 347 | /** |
| 348 | 348 | * @param $sourceEntityInstance |
| 349 | + * @param Model $checkInstance |
|
| 349 | 350 | * @throws ODataException |
| 350 | 351 | */ |
| 351 | 352 | private function checkAuth($sourceEntityInstance, $checkInstance = null) |
@@ -124,14 +124,14 @@ |
||
| 124 | 124 | // loop thru, chunk by chunk, to reduce chances of exhausting memory |
| 125 | 125 | $sourceEntityInstance->chunk( |
| 126 | 126 | 5000, |
| 127 | - function ($results) use ($isvalid, &$skip, &$resultSet, &$rawCount, $rawTop) { |
|
| 127 | + function($results) use ($isvalid, &$skip, &$resultSet, &$rawCount, $rawTop) { |
|
| 128 | 128 | // apply filter |
| 129 | 129 | $results = $results->filter($isvalid); |
| 130 | 130 | // need to iterate through full result set to find count of items matching filter, |
| 131 | 131 | // so we can't bail out early |
| 132 | 132 | $rawCount += $results->count(); |
| 133 | 133 | // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz |
| 134 | - if ($rawTop > $resultSet->count() + $skip) { |
|
| 134 | + if ($rawTop > $resultSet->count()+$skip) { |
|
| 135 | 135 | $resultSet = collect(array_merge($resultSet->all(), $results->all())); |
| 136 | 136 | $sliceAmount = min($skip, $resultSet->count()); |
| 137 | 137 | $resultSet = $resultSet->slice($sliceAmount); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * @return mixed |
|
| 70 | + * @return boolean |
|
| 71 | 71 | */ |
| 72 | 72 | protected function getIsDumping() |
| 73 | 73 | { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $date = Carbon::now(0); |
| 44 | 44 | $timeString = $date->toTimeString(); |
| 45 | 45 | $xTest = (null !== $xTest) ? $xTest |
| 46 | - : $request->method() . ";" . str_replace("/", "-", $request->path()) . ";" . $timeString . ";"; |
|
| 46 | + : $request->method().";".str_replace("/", "-", $request->path()).";".$timeString.";"; |
|
| 47 | 47 | if (null != $xTest) { |
| 48 | 48 | $reflectionClass = new \ReflectionClass('Illuminate\Http\Request'); |
| 49 | 49 | $reflectionProperty = $reflectionClass->getProperty('userResolver'); |
@@ -395,6 +395,9 @@ discard block |
||
| 395 | 395 | return $this->stack; |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | + /** |
|
| 399 | + * @param string $containerName |
|
| 400 | + */ |
|
| 398 | 401 | protected function getEntryInstanceKey($entityInstance, ResourceType $resourceType, $containerName) |
| 399 | 402 | { |
| 400 | 403 | $typeName = $resourceType->getName(); |
@@ -426,7 +429,7 @@ discard block |
||
| 426 | 429 | /** |
| 427 | 430 | * @param $entryObject |
| 428 | 431 | * @param $type |
| 429 | - * @param $relativeUri |
|
| 432 | + * @param string $relativeUri |
|
| 430 | 433 | * @param $resourceType |
| 431 | 434 | * @return array |
| 432 | 435 | */ |
@@ -493,7 +496,7 @@ discard block |
||
| 493 | 496 | * Find a 'ExpandedProjectionNode' instance in the projection tree |
| 494 | 497 | * which describes the current segment. |
| 495 | 498 | * |
| 496 | - * @return ExpandedProjectionNode|null |
|
| 499 | + * @return null|\POData\UriProcessor\QueryProcessor\ExpandProjectionParser\RootProjectionNode|ExpandedProjectionNode |
|
| 497 | 500 | */ |
| 498 | 501 | protected function getCurrentExpandedProjectionNode() |
| 499 | 502 | { |
@@ -664,7 +667,7 @@ discard block |
||
| 664 | 667 | /** |
| 665 | 668 | * @param $entryObject |
| 666 | 669 | * @param $prop |
| 667 | - * @param $nuLink |
|
| 670 | + * @param ODataLink $nuLink |
|
| 668 | 671 | * @param $propKind |
| 669 | 672 | * @param $propName |
| 670 | 673 | */ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $this->service = $service; |
| 95 | 95 | $this->request = $request; |
| 96 | 96 | $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString(); |
| 97 | - $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/'; |
|
| 97 | + $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/'; |
|
| 98 | 98 | $this->stack = new SegmentStack($request); |
| 99 | 99 | $this->complexTypeInstanceCollection = []; |
| 100 | 100 | $this->modelSerialiser = new ModelSerialiser(); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $resourceType, |
| 141 | 141 | $resourceSet->getName() |
| 142 | 142 | ); |
| 143 | - $absoluteUri = rtrim($this->absoluteServiceUri, '/') . '/' . $relativeUri; |
|
| 143 | + $absoluteUri = rtrim($this->absoluteServiceUri, '/').'/'.$relativeUri; |
|
| 144 | 144 | |
| 145 | 145 | list($mediaLink, $mediaLinks) = $this->writeMediaData($entryObject, $type, $relativeUri, $resourceType); |
| 146 | 146 | |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | $propType = 'application/atom+xml;type='.$propTail; |
| 162 | 162 | $propName = $prop->getName(); |
| 163 | 163 | $nuLink->title = $propName; |
| 164 | - $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName; |
|
| 165 | - $nuLink->url = $relativeUri . '/' . $propName; |
|
| 164 | + $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE.$propName; |
|
| 165 | + $nuLink->url = $relativeUri.'/'.$propName; |
|
| 166 | 166 | $nuLink->type = $propType; |
| 167 | 167 | |
| 168 | 168 | $navProp = new ODataNavigationPropertyInfo($prop, $this->shouldExpandSegment($propName)); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $segment = $this->getNextLinkUri($lastObject, $absoluteUri); |
| 234 | 234 | $nextLink = new ODataLink(); |
| 235 | 235 | $nextLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING; |
| 236 | - $nextLink->url = rtrim($this->absoluteServiceUri, '/') . '/' . $stackSegment . $segment; |
|
| 236 | + $nextLink->url = rtrim($this->absoluteServiceUri, '/').'/'.$stackSegment.$segment; |
|
| 237 | 237 | $odata->nextPageLink = $nextLink; |
| 238 | 238 | } |
| 239 | 239 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $this->getCurrentResourceSetWrapper()->getName() |
| 259 | 259 | ); |
| 260 | 260 | |
| 261 | - $url->url = rtrim($this->absoluteServiceUri, '/') . '/' . $relativeUri; |
|
| 261 | + $url->url = rtrim($this->absoluteServiceUri, '/').'/'.$relativeUri; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | return $url; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $segment = $this->getNextLinkUri($lastObject, $this->getRequest()->getRequestUrl()->getUrlAsString()); |
| 289 | 289 | $nextLink = new ODataLink(); |
| 290 | 290 | $nextLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING; |
| 291 | - $nextLink->url = rtrim($this->absoluteServiceUri, '/') . '/' . $stackSegment . $segment; |
|
| 291 | + $nextLink->url = rtrim($this->absoluteServiceUri, '/').'/'.$stackSegment.$segment; |
|
| 292 | 292 | $urls->nextPageLink = $nextLink; |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | * @return ODataPropertyContent |
| 314 | 314 | * @codeCoverageIgnore |
| 315 | 315 | */ |
| 316 | - public function writeTopLevelComplexObject(&$complexValue, $propertyName, ResourceType &$resourceType) |
|
| 316 | + public function writeTopLevelComplexObject(&$complexValue, $propertyName, ResourceType & $resourceType) |
|
| 317 | 317 | { |
| 318 | 318 | // TODO: Figure out if we need to bother implementing this |
| 319 | 319 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * @codeCoverageIgnore |
| 331 | 331 | * @return ODataPropertyContent |
| 332 | 332 | */ |
| 333 | - public function writeTopLevelBagObject(&$BagValue, $propertyName, ResourceType &$resourceType) |
|
| 333 | + public function writeTopLevelBagObject(&$BagValue, $propertyName, ResourceType & $resourceType) |
|
| 334 | 334 | { |
| 335 | 335 | // TODO: Figure out if we need to bother implementing this |
| 336 | 336 | } |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | * @codeCoverageIgnore |
| 348 | 348 | * @return ODataPropertyContent |
| 349 | 349 | */ |
| 350 | - public function writeTopLevelPrimitive(&$primitiveValue, ResourceProperty &$resourceProperty = null) |
|
| 350 | + public function writeTopLevelPrimitive(&$primitiveValue, ResourceProperty & $resourceProperty = null) |
|
| 351 | 351 | { |
| 352 | 352 | // TODO: Figure out if we need to bother implementing this |
| 353 | 353 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $typeName = $resourceType->getName(); |
| 401 | 401 | $keyProperties = $resourceType->getKeyProperties(); |
| 402 | 402 | assert(count($keyProperties) != 0, 'count($keyProperties) == 0'); |
| 403 | - $keyString = $containerName . '('; |
|
| 403 | + $keyString = $containerName.'('; |
|
| 404 | 404 | $comma = null; |
| 405 | 405 | foreach ($keyProperties as $keyName => $resourceProperty) { |
| 406 | 406 | $keyType = $resourceProperty->getInstanceType(); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | $keyValue = $keyType->convertToOData($keyValue); |
| 417 | - $keyString .= $comma . $keyName . '=' . $keyValue; |
|
| 417 | + $keyString .= $comma.$keyName.'='.$keyValue; |
|
| 418 | 418 | $comma = ','; |
| 419 | 419 | } |
| 420 | 420 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | $mediaLink = null; |
| 440 | 440 | if ($resourceType->isMediaLinkEntry()) { |
| 441 | 441 | $eTag = $streamProviderWrapper->getStreamETag2($entryObject, null, $context); |
| 442 | - $mediaLink = new ODataMediaLink($type, '/$value', $relativeUri . '/$value', '*/*', $eTag); |
|
| 442 | + $mediaLink = new ODataMediaLink($type, '/$value', $relativeUri.'/$value', '*/*', $eTag); |
|
| 443 | 443 | } |
| 444 | 444 | $mediaLinks = []; |
| 445 | 445 | if ($resourceType->hasNamedStream()) { |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $segmentWrappers = $this->getStack()->getSegmentWrappers(); |
| 581 | 581 | $count = count($segmentWrappers); |
| 582 | 582 | |
| 583 | - return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count - 1]; |
|
| 583 | + return 0 == $count ? $this->getRequest()->getTargetResourceSetWrapper() : $segmentWrappers[$count-1]; |
|
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | /** |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | * |
| 621 | 621 | * @return string |
| 622 | 622 | */ |
| 623 | - private function primitiveToString(IType &$type, $primitiveValue) |
|
| 623 | + private function primitiveToString(IType & $type, $primitiveValue) |
|
| 624 | 624 | { |
| 625 | 625 | if ($type instanceof Boolean) { |
| 626 | 626 | $stringValue = (true === $primitiveValue) ? 'true' : 'false'; |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | $nuLink->expandedResult->selfLink->title = $propName; |
| 691 | 691 | $nuLink->expandedResult->selfLink->url = $nuLink->url; |
| 692 | 692 | $nuLink->expandedResult->title = $propName; |
| 693 | - $nuLink->expandedResult->id = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->url; |
|
| 693 | + $nuLink->expandedResult->id = rtrim($this->absoluteServiceUri, '/').'/'.$nuLink->url; |
|
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | } |
@@ -704,6 +704,6 @@ discard block |
||
| 704 | 704 | { |
| 705 | 705 | $this->service = $service; |
| 706 | 706 | $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString(); |
| 707 | - $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/'; |
|
| 707 | + $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/'; |
|
| 708 | 708 | } |
| 709 | 709 | } |