@@ -98,7 +98,7 @@ |
||
98 | 98 | */ |
99 | 99 | public function register() |
100 | 100 | { |
101 | - $this->app->singleton('metadata', function ($app) { |
|
101 | + $this->app->singleton('metadata', function($app) { |
|
102 | 102 | return new SimpleMetadataProvider('Data', self::$METANAMESPACE); |
103 | 103 | }); |
104 | 104 | } |
@@ -3,7 +3,6 @@ |
||
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 | 8 | use POData\Providers\Metadata\SimpleMetadataProvider; |
@@ -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 | } |
@@ -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)) { |
@@ -301,7 +301,7 @@ |
||
301 | 301 | if (!isset($functionDescription)) { |
302 | 302 | throw new \InvalidArgumentException('onFunctionCallExpression'); |
303 | 303 | } |
304 | - if(!array_key_exists ($functionDescription->name, $this->functionDescriptionParsers)){ |
|
304 | + if (!array_key_exists($functionDescription->name, $this->functionDescriptionParsers)) { |
|
305 | 305 | throw new \InvalidArgumentException('onFunctionCallExpression'); |
306 | 306 | } |
307 | 307 | return $this->functionDescriptionParsers[$functionDescription->name]($params); |
@@ -96,14 +96,14 @@ |
||
96 | 96 | // loop thru, chunk by chunk, to reduce chances of exhausting memory |
97 | 97 | $sourceEntityInstance->chunk( |
98 | 98 | 5000, |
99 | - function ($results) use ($isvalid, &$skipToken, &$resultSet, &$rawCount, $rawTop) { |
|
99 | + function($results) use ($isvalid, &$skipToken, &$resultSet, &$rawCount, $rawTop) { |
|
100 | 100 | // apply filter |
101 | 101 | $results = $results->filter($isvalid); |
102 | 102 | // need to iterate through full result set to find count of items matching filter, |
103 | 103 | // so we can't bail out early |
104 | 104 | $rawCount += $results->count(); |
105 | 105 | // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz |
106 | - if ($rawTop > $resultSet->count() + $skipToken) { |
|
106 | + if ($rawTop > $resultSet->count()+$skipToken) { |
|
107 | 107 | $resultSet = collect(array_merge($resultSet->all(), $results->all())); |
108 | 108 | $sliceAmount = min($skipToken, $resultSet->count()); |
109 | 109 | $resultSet = $resultSet->slice($sliceAmount); |
@@ -465,8 +465,8 @@ discard block |
||
465 | 465 | } |
466 | 466 | |
467 | 467 | /** |
468 | - * @param $foo |
|
469 | - * @return array |
|
468 | + * @param BelongsToMany $foo |
|
469 | + * @return string[] |
|
470 | 470 | */ |
471 | 471 | private function polyglotKeyMethodNames($foo) |
472 | 472 | { |
@@ -482,8 +482,8 @@ discard block |
||
482 | 482 | * @param $first |
483 | 483 | * @param $property |
484 | 484 | * @param $last |
485 | - * @param $mult |
|
486 | - * @param $targ |
|
485 | + * @param string $mult |
|
486 | + * @param string $targ |
|
487 | 487 | */ |
488 | 488 | private function addRelationsHook(&$hooks, $first, $property, $last, $mult, $targ) |
489 | 489 | { |
@@ -201,10 +201,10 @@ discard block |
||
201 | 201 | |
202 | 202 | $keyRaw = $isMany ? $foo->$fkMethodName() : $foo->getForeignKey(); |
203 | 203 | $keySegments = explode('.', $keyRaw); |
204 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
204 | + $keyName = $keySegments[count($keySegments)-1]; |
|
205 | 205 | $localRaw = $isMany ? $foo->$rkMethodName() : $foo->getQualifiedParentKeyName(); |
206 | 206 | $localSegments = explode('.', $localRaw); |
207 | - $localName = $localSegments[count($localSegments) - 1]; |
|
207 | + $localName = $localSegments[count($localSegments)-1]; |
|
208 | 208 | |
209 | 209 | $first = $keyName; |
210 | 210 | $last = $localName; |
@@ -223,10 +223,10 @@ discard block |
||
223 | 223 | |
224 | 224 | $keyRaw = $isMany ? $foo->$fkMethodName() : $foo->getForeignKeyName(); |
225 | 225 | $keySegments = explode('.', $keyRaw); |
226 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
226 | + $keyName = $keySegments[count($keySegments)-1]; |
|
227 | 227 | $localRaw = $isMany ? $foo->$rkMethodName() : $foo->getQualifiedParentKeyName(); |
228 | 228 | $localSegments = explode('.', $localRaw); |
229 | - $localName = $localSegments[count($localSegments) - 1]; |
|
229 | + $localName = $localSegments[count($localSegments)-1]; |
|
230 | 230 | $first = $isMany ? $keyName : $localName; |
231 | 231 | $last = $isMany ? $localName : $keyName; |
232 | 232 | $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $keyName = $isBelong ? $foo->getForeignKey() : $foo->getForeignKeyName(); |
243 | 243 | $localRaw = $isBelong ? $foo->getOwnerKey() : $foo->getQualifiedParentKeyName(); |
244 | 244 | $localSegments = explode('.', $localRaw); |
245 | - $localName = $localSegments[count($localSegments) - 1]; |
|
245 | + $localName = $localSegments[count($localSegments)-1]; |
|
246 | 246 | $first = $isBelong ? $localName : $keyName; |
247 | 247 | $last = $isBelong ? $keyName : $localName; |
248 | 248 | $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ); |
@@ -261,10 +261,10 @@ discard block |
||
261 | 261 | |
262 | 262 | $keyRaw = $isBelong ? $foo->$fkMethodName() : $foo->getForeignKeyName(); |
263 | 263 | $keySegments = explode('.', $keyRaw); |
264 | - $keyName = $keySegments[count($keySegments) - 1]; |
|
264 | + $keyName = $keySegments[count($keySegments)-1]; |
|
265 | 265 | $localRaw = $isBelong ? $foo->$rkMethodName() : $foo->getQualifiedParentKeyName(); |
266 | 266 | $localSegments = explode('.', $localRaw); |
267 | - $localName = $localSegments[count($localSegments) - 1]; |
|
267 | + $localName = $localSegments[count($localSegments)-1]; |
|
268 | 268 | $first = $keyName; |
269 | 269 | $last = $localName; |
270 | 270 | $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ); |