@@ -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 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public function setResourceType(ResourceType $resourceType) |
68 | 68 | { |
69 | - $this->iteratorName = "$" . $resourceType->getName(); |
|
69 | + $this->iteratorName = "$".$resourceType->getName(); |
|
70 | 70 | $this->resourceType = $resourceType; |
71 | 71 | } |
72 | 72 | /** |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Illuminate\Support\ServiceProvider; |
6 | 6 | use Illuminate\Support\Facades\Cache; |
7 | - |
|
8 | 7 | use AlgoWeb\PODataLaravel\Controllers\MetadataControllerContainer; |
9 | 8 | |
10 | 9 | class MetadataControllerProvider extends ServiceProvider |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | foreach ($lock as $barrel => $roll) { |
62 | 62 | assert( |
63 | 63 | !array_key_exists($barrel, $metamix[$key]), |
64 | - 'Mapping already defined for model '.$key. ' and CRUD verb '.$barrel |
|
64 | + 'Mapping already defined for model '.$key.' and CRUD verb '.$barrel |
|
65 | 65 | ); |
66 | 66 | $metamix[$key][$barrel] = $roll; |
67 | 67 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function register() |
82 | 82 | { |
83 | - $this->app->singleton('metadataControllers', function ($app) { |
|
83 | + $this->app->singleton('metadataControllers', function($app) { |
|
84 | 84 | return new MetadataControllerContainer(); |
85 | 85 | }); |
86 | 86 | } |
@@ -15,9 +15,6 @@ |
||
15 | 15 | use \POData\Common\ODataException; |
16 | 16 | use AlgoWeb\PODataLaravel\Interfaces\AuthInterface; |
17 | 17 | use AlgoWeb\PODataLaravel\Auth\NullAuthProvider; |
18 | - |
|
19 | - |
|
20 | -use Illuminate\Support\Facades\DB; |
|
21 | 18 | use Illuminate\Support\Facades\App; |
22 | 19 | |
23 | 20 | class LaravelQuery implements IQueryProvider |
@@ -373,12 +373,12 @@ discard block |
||
373 | 373 | $map = $raw->getMetadata(); |
374 | 374 | |
375 | 375 | if (!array_key_exists($class, $map)) { |
376 | - throw new \POData\Common\InvalidOperationException('Controller mapping missing for class ' . $class); |
|
376 | + throw new \POData\Common\InvalidOperationException('Controller mapping missing for class '.$class); |
|
377 | 377 | } |
378 | 378 | $goal = $raw->getMapping($class, $verb); |
379 | 379 | if (null == $goal) { |
380 | 380 | throw new \POData\Common\InvalidOperationException( |
381 | - 'Controller mapping missing for ' . $verb . ' verb on class ' . $class |
|
381 | + 'Controller mapping missing for '.$verb.' verb on class '.$class |
|
382 | 382 | ); |
383 | 383 | } |
384 | 384 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | $data = []; |
387 | 387 | } |
388 | 388 | if (is_object($data)) { |
389 | - $data = (array)$data; |
|
389 | + $data = (array) $data; |
|
390 | 390 | } |
391 | 391 | if (!is_array($data)) { |
392 | 392 | throw \POData\Common\ODataException::createPreConditionFailedError( |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | /** |
315 | 315 | * Delete resource from a resource set. |
316 | - * @param ResourceSet|null $resourceSet |
|
316 | + * @param ResourceSet|null $sourceResourceSet |
|
317 | 317 | * @param object $sourceEntityInstance |
318 | 318 | * |
319 | 319 | * return bool true if resources sucessfully deteled, otherwise false. |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | * @param $sourceEntityInstance |
363 | 363 | * @param $data |
364 | 364 | * @param $class |
365 | - * @param $verb |
|
365 | + * @param string $verb |
|
366 | 366 | * @return array|mixed |
367 | 367 | * @throws ODataException |
368 | 368 | * @throws \POData\Common\InvalidOperationException |
@@ -48,23 +48,23 @@ discard block |
||
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 | |
64 | 64 | $class = get_class($this); |
65 | 65 | $parmArray = $this->getParameterNames($result); |
66 | 66 | |
67 | - return [ 'method' => $result, 'controller' => $class, 'parameters' => $parmArray]; |
|
67 | + return ['method' => $result, 'controller' => $class, 'parameters' => $parmArray]; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public function getMappings() |
@@ -86,12 +86,12 @@ discard block |
||
86 | 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); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | $class = get_class($this); |
103 | - $allMappings[$key][$verb] = [ 'method' => $method, 'controller' => $class, 'parameters' => $parmArray]; |
|
103 | + $allMappings[$key][$verb] = ['method' => $method, 'controller' => $class, 'parameters' => $parmArray]; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | return $allMappings; |