@@ -2,9 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace EloquentJs\Console; |
| 4 | 4 | |
| 5 | -use EloquentJs\Generator\EndpointLocator; |
|
| 6 | 5 | use EloquentJs\Generator\Generator; |
| 7 | -use EloquentJs\Generator\ModelFinder; |
|
| 8 | 6 | use EloquentJs\Generator\ModelInputParser; |
| 9 | 7 | use Illuminate\Console\Command; |
| 10 | 8 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | protected function printMapping($models) |
| 82 | 82 | { |
| 83 | - $rows = array_map(function ($model, $endpoint) { |
|
| 83 | + $rows = array_map(function($model, $endpoint) { |
|
| 84 | 84 | return [$model, $endpoint]; |
| 85 | 85 | }, array_keys($models), $models); |
| 86 | 86 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | protected function populateMissingEndpoints(&$models) |
| 96 | 96 | { |
| 97 | - array_walk($models, function (&$endpoint, $model) { |
|
| 97 | + array_walk($models, function(&$endpoint, $model) { |
|
| 98 | 98 | if (empty($endpoint)) { |
| 99 | 99 | $endpoint = $this->ask("Enter the endpoint to use for the '{$model}' model"); |
| 100 | 100 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function register() |
| 23 | 23 | { |
| 24 | - $this->app->bind(QueryTranslator::class, function ($app) { |
|
| 24 | + $this->app->bind(QueryTranslator::class, function($app) { |
|
| 25 | 25 | return new JsonQueryTranslator($app['request']->input('query', '[]')); |
| 26 | 26 | }); |
| 27 | 27 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function addGenericResourceRouting(Router $router) |
| 51 | 51 | { |
| 52 | - $router->macro('eloquent', function ($uri, $resource, $options = []) use ($router) { |
|
| 52 | + $router->macro('eloquent', function($uri, $resource, $options = []) use ($router) { |
|
| 53 | 53 | |
| 54 | 54 | // The $router->resource() method doesn't allow custom route attributes |
| 55 | 55 | // in the $options array. So, while the group() may look redundant here, |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // |
| 59 | 59 | // This is so when we come to resolve the controller (see below), we |
| 60 | 60 | // can easily tell what type of resource we need, i.e. which model. |
| 61 | - $router->group(compact('resource'), function ($router) use ($uri, $options) { |
|
| 61 | + $router->group(compact('resource'), function($router) use ($uri, $options) { |
|
| 62 | 62 | |
| 63 | 63 | if (empty($options['only'])) { // Exclude the routes for displaying forms |
| 64 | 64 | $options['except'] = (array) array_get($options, 'except', []) + ['create', 'edit']; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | // Typically you'd have dedicated controllers for each resource. |
| 73 | 73 | // Since that's not the case here, we need some way of telling |
| 74 | 74 | // our generic controller which resource we're working with. |
| 75 | - $this->app->resolving(function (GenericResourceController $controller) { |
|
| 75 | + $this->app->resolving(function(GenericResourceController $controller) { |
|
| 76 | 76 | |
| 77 | 77 | $currentRoute = $this->app['router']->current(); |
| 78 | 78 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * @type string location of the base EloquentJs build |
| 22 | 22 | */ |
| 23 | - const BASE_BUILD = __DIR__ . '/../../eloquent.js'; |
|
| 23 | + const BASE_BUILD = __DIR__.'/../../eloquent.js'; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * @param Filesystem $files |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | public function inList(array $classes, $namespace = null) |
| 42 | 42 | { |
| 43 | 43 | if ($namespace) { |
| 44 | - array_walk($classes, function (&$className) use ($namespace) { |
|
| 45 | - $className = str_replace('\\\\', '\\', $namespace . '\\' . $className); |
|
| 44 | + array_walk($classes, function(&$className) use ($namespace) { |
|
| 45 | + $className = str_replace('\\\\', '\\', $namespace.'\\'.$className); |
|
| 46 | 46 | }); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function getScopes() |
| 50 | 50 | { |
| 51 | - return array_map(function ($method) { |
|
| 51 | + return array_map(function($method) { |
|
| 52 | 52 | return lcfirst(substr($method, 5)); |
| 53 | 53 | }, $this->getScopeMethods()); |
| 54 | 54 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | protected function getScopeMethods() |
| 64 | 64 | { |
| 65 | 65 | return array_values( |
| 66 | - array_filter(get_class_methods($this->model), function ($method) { |
|
| 66 | + array_filter(get_class_methods($this->model), function($method) { |
|
| 67 | 67 | return substr($method, 0, 5) === 'scope' && ! in_array($method, ['scopeScope', 'scopeUseEloquentJs']); |
| 68 | 68 | }) |
| 69 | 69 | ); |