@@ -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 | } |
@@ -48,16 +48,16 @@ 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 | |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | throw new \Exception('CRUD verb '.$verb.' not defined'); |
| 86 | 86 | } |
| 87 | 87 | if (!isset($method)) { |
| 88 | - throw new \Exception('Metadata mapping for CRUD verb '. $verb.' on model '.$key.' null'); |
|
| 88 | + throw new \Exception('Metadata mapping for CRUD verb '.$verb.' on model '.$key.' null'); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | if (!method_exists($this, $method)) { |
| 92 | 92 | throw new \Exception( |
| 93 | - 'Metadata target for CRUD verb '. $verb.' on model '.$key.' does not exist' |
|
| 93 | + 'Metadata target for CRUD verb '.$verb.' on model '.$key.' does not exist' |
|
| 94 | 94 | ); |
| 95 | 95 | } |
| 96 | 96 | $parmArray = $this->getParameterNames($method); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $allMappings[$key] = []; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $allMappings[$key][$verb] = [ $method, $parmArray]; |
|
| 101 | + $allMappings[$key][$verb] = [$method, $parmArray]; |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | return $allMappings; |