Completed
Branch master (2dfacb)
by Nick
04:48
created
src/Console/GenerateJavascript.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Controllers/GenericResourceController.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      * Store a newly created resource in storage.
38 38
      *
39 39
      * @param  \Illuminate\Http\Request  $request
40
-     * @return \Illuminate\Http\Response
40
+     * @return Model
41 41
      */
42 42
     public function store(Request $request)
43 43
     {
Please login to merge, or discard this patch.
src/EloquentJsServiceProvider.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     public function register()
23 23
     {
24 24
         $this->app->bind(QueryTranslator::class, function ($app) {
25
-           return new JsonQueryTranslator($app['request']->input('query', '[]'));
25
+            return new JsonQueryTranslator($app['request']->input('query', '[]'));
26 26
         });
27 27
 
28 28
         $this->commands([GenerateJavascript::class]);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Generator/Generator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Generator/ModelFinder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Generator/ModelInspector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.