Completed
Pull Request — master (#66)
by
unknown
01:44
created
lumen-test/app/Http/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-$router->get("/", function () use ($router) {
14
+$router->get("/", function() use ($router) {
15 15
     return 'Hello World';
16 16
 });
Please login to merge, or discard this patch.
lumen-test/bootstrap/app.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__.'/../vendor/autoload.php';
3
+require_once __DIR__ . '/../vendor/autoload.php';
4 4
 
5 5
 try {
6
-    (new Dotenv\Dotenv(__DIR__.'/../'))->load();
6
+    (new Dotenv\Dotenv(__DIR__ . '/../'))->load();
7 7
 } catch (Dotenv\Exception\InvalidPathException $e) {
8 8
     //
9 9
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 */
21 21
 
22 22
 $app = new Laravel\Lumen\Application(
23
-    realpath(__DIR__.'/../')
23
+    realpath(__DIR__ . '/../')
24 24
 );
25 25
 
26 26
 $app->withFacades();
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 
99 99
 $app->router->group([
100 100
     'namespace' => 'App\Http\Controllers',
101
-], function ($router) {
102
-    require __DIR__.'/../app/Http/routes.php';
101
+], function($router) {
102
+    require __DIR__ . '/../app/Http/routes.php';
103 103
 });
104 104
 
105 105
 return $app;
Please login to merge, or discard this patch.
lumen-test/tests/acceptance/ResourceCommandCept.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
 $I->seeInThisFile('protected $fillable = ["name", "descr", "due", "project_id", "creator_id"];');
15 15
 $I->seeInThisFile('protected $dates = ["due"];');
16 16
 $I->seeInThisFile(
17
-"public static \$rules = [\n".
17
+"public static \$rules = [\n" .
18 18
 "        \"name\" => \"requied\"," . PHP_EOL .
19 19
 "        \"project_id\" => \"required|numeric\"," . PHP_EOL .
20
-"        \"creator_id\" => \"required|numeric\",\n".
20
+"        \"creator_id\" => \"required|numeric\",\n" .
21 21
 "    ];");
22 22
 $I->seeInThisFile(
23 23
 '    public function tags()
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
 $I->openFile('./database/migrations/create_task_categories.php');
48 48
 
49 49
 $I->seeInThisFile('class CreateTaskCategoriesTable extends Migration');
50
-$I->seeInThisFile("Schema::create('task_categories', function(Blueprint \$table) {\n".
51
-"            \$table->increments('id');\n".
50
+$I->seeInThisFile("Schema::create('task_categories', function(Blueprint \$table) {\n" .
51
+"            \$table->increments('id');\n" .
52 52
 "            \$table->string('name')->unique();" . PHP_EOL .
53 53
 "            \$table->text('descr')->nullable();" . PHP_EOL .
54 54
 "            \$table->timestamp('due');" . PHP_EOL .
55
-"            \$table->integer('project_id')->unsigned();" . PHP_EOL.
55
+"            \$table->integer('project_id')->unsigned();" . PHP_EOL .
56 56
 "            \$table->integer('creator_id')->unsigned();\n" .
57
-"            \$table->foreign('project_id')\n".
58
-"                ->references('id')\n".
57
+"            \$table->foreign('project_id')\n" .
58
+"                ->references('id')\n" .
59 59
 "                ->on('projects');" . PHP_EOL .
60
-"            \$table->foreign('creator_id')\n".
61
-"                ->references('id')\n".
62
-"                ->on('users');\n".
60
+"            \$table->foreign('creator_id')\n" .
61
+"                ->references('id')\n" .
62
+"                ->on('users');\n" .
63 63
 "            \$table->timestamps();");
64 64
 
65 65
 $I->deleteFile('./database/migrations/create_task_categories.php');
Please login to merge, or discard this patch.
src/CommandsServiceProvider.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -22,92 +22,92 @@
 block discarded – undo
22 22
         // registerTestCommand
23 23
     }
24 24
 
25
-    protected function registerModelCommand(){
26
-        $this->app->singleton('command.wn.model', function($app){
25
+    protected function registerModelCommand() {
26
+        $this->app->singleton('command.wn.model', function($app) {
27 27
             return $app['Wn\Generators\Commands\ModelCommand'];
28 28
         });
29 29
         $this->commands('command.wn.model');
30 30
     }
31 31
 
32
-    protected function registerControllerRestActionsCommand(){
33
-        $this->app->singleton('command.wn.controller.rest-actions', function($app){
32
+    protected function registerControllerRestActionsCommand() {
33
+        $this->app->singleton('command.wn.controller.rest-actions', function($app) {
34 34
             return $app['Wn\Generators\Commands\ControllerRestActionsCommand'];
35 35
         });
36 36
         $this->commands('command.wn.controller.rest-actions');
37 37
     }
38 38
 
39
-    protected function registerControllerCommand(){
40
-        $this->app->singleton('command.wn.controller', function($app){
39
+    protected function registerControllerCommand() {
40
+        $this->app->singleton('command.wn.controller', function($app) {
41 41
             return $app['Wn\Generators\Commands\ControllerCommand'];
42 42
         });
43 43
         $this->commands('command.wn.controller');
44 44
     }
45 45
 
46
-    protected function registerMigrationCommand(){
47
-        $this->app->singleton('command.wn.migration', function($app){
46
+    protected function registerMigrationCommand() {
47
+        $this->app->singleton('command.wn.migration', function($app) {
48 48
             return $app['Wn\Generators\Commands\MigrationCommand'];
49 49
         });
50 50
         $this->commands('command.wn.migration');
51 51
     }
52 52
 
53
-    protected function registerRouteCommand(){
54
-        $this->app->singleton('command.wn.route', function($app){
53
+    protected function registerRouteCommand() {
54
+        $this->app->singleton('command.wn.route', function($app) {
55 55
             return $app['Wn\Generators\Commands\RouteCommand'];
56 56
         });
57 57
         $this->commands('command.wn.route');
58 58
     }
59 59
 
60
-    protected function registerTestCommand(){
61
-        $this->app->singleton('command.wn.test', function($app){
60
+    protected function registerTestCommand() {
61
+        $this->app->singleton('command.wn.test', function($app) {
62 62
             return $app['Wn\Generators\Commands\TestCommand'];
63 63
         });
64 64
         $this->commands('command.wn.test');
65 65
     }
66 66
 
67
-    protected function registerResourceCommand(){
68
-        $this->app->singleton('command.wn.resource', function($app){
67
+    protected function registerResourceCommand() {
68
+        $this->app->singleton('command.wn.resource', function($app) {
69 69
             return $app['Wn\Generators\Commands\ResourceCommand'];
70 70
         });
71 71
         $this->commands('command.wn.resource');
72 72
     }
73 73
 
74
-    protected function registerResourcesCommand(){
75
-        $this->app->singleton('command.wn.resources', function($app){
74
+    protected function registerResourcesCommand() {
75
+        $this->app->singleton('command.wn.resources', function($app) {
76 76
             return $app['Wn\Generators\Commands\ResourcesCommand'];
77 77
         });
78 78
         $this->commands('command.wn.resources');
79 79
     }
80 80
 
81
-    protected function registerPivotTableCommand(){
82
-        $this->app->singleton('command.wn.pivot-table', function($app){
81
+    protected function registerPivotTableCommand() {
82
+        $this->app->singleton('command.wn.pivot-table', function($app) {
83 83
             return $app['Wn\Generators\Commands\PivotTableCommand'];
84 84
         });
85 85
         $this->commands('command.wn.pivot-table');
86 86
     }
87 87
 
88
-    protected function registerMorphTableCommand(){
89
-        $this->app->singleton('command.wn.morph-table', function($app){
88
+    protected function registerMorphTableCommand() {
89
+        $this->app->singleton('command.wn.morph-table', function($app) {
90 90
             return $app['Wn\Generators\Commands\MorphTableCommand'];
91 91
         });
92 92
         $this->commands('command.wn.morph-table');
93 93
     }
94 94
 
95
-    protected function registerFactoryCommand(){
96
-        $this->app->singleton('command.wn.factory', function($app){
95
+    protected function registerFactoryCommand() {
96
+        $this->app->singleton('command.wn.factory', function($app) {
97 97
             return $app['Wn\Generators\Commands\FactoryCommand'];
98 98
         });
99 99
         $this->commands('command.wn.factory');
100 100
     }
101 101
 
102
-    protected function registerSeederCommand(){
103
-        $this->app->singleton('command.wn.seeder', function($app){
102
+    protected function registerSeederCommand() {
103
+        $this->app->singleton('command.wn.seeder', function($app) {
104 104
             return $app['Wn\Generators\Commands\SeederCommand'];
105 105
         });
106 106
         $this->commands('command.wn.seeder');
107 107
     }
108 108
 
109
-    protected function registerPivotSeederCommand(){
110
-        $this->app->singleton('command.wn.pivot.seeder', function($app){
109
+    protected function registerPivotSeederCommand() {
110
+        $this->app->singleton('command.wn.pivot.seeder', function($app) {
111 111
             return $app['Wn\Generators\Commands\PivotSeederCommand'];
112 112
         });
113 113
         $this->commands('command.wn.pivot.seeder');
Please login to merge, or discard this patch.
src/Commands/FactoryCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
         $file = $this->getFile();
21 21
 
22
-        $content = ! $this->fs->exists($file) ? '' : $this->fs->get($file);
22
+        $content = !$this->fs->exists($file) ? '' : $this->fs->get($file);
23 23
 
24
-        $content .= $this->getTemplate(! $this->fs->exists($file) ? 'factory-create' : 'factory')
24
+        $content .= $this->getTemplate(!$this->fs->exists($file) ? 'factory-create' : 'factory')
25 25
             ->with([
26 26
                 'model' => $model,
27 27
                 'factory_fields' => $this->getFieldsContent()
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     protected function getFile()
35 35
     {
36 36
         $file = $this->option('file');
37
-        if(! $file){
37
+        if (!$file) {
38 38
             $file = './database/factories/ModelFactory.php';
39 39
         }
40 40
         return $file;
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 
47 47
         $fields = $this->option('fields');
48 48
 
49
-        if($fields){
50
-            if(! $this->option('parsed')){
49
+        if ($fields) {
50
+            if (!$this->option('parsed')) {
51 51
                 $fields = $this->getArgumentParser('factory-fields')->parse($fields);
52 52
             }
53 53
             $template = $this->getTemplate('factory/field');
54
-            foreach($fields as $field){
54
+            foreach ($fields as $field) {
55 55
                 $content[] = $template->with($field)->get();
56 56
             }
57 57
             $content = implode(PHP_EOL, $content);
Please login to merge, or discard this patch.
src/Commands/MigrationCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $snakeName = snake_case($name);
25 25
 
26 26
         $file = $this->option('file');
27
-        if (! $file) {
27
+        if (!$file) {
28 28
             $file = date('Y_m_d_His_') . $snakeName . '_table';
29 29
             $this->deleteOldMigration($snakeName);
30 30
         } else {
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
     protected function deleteOldMigration($fileName)
48 48
     {
49
-        foreach (new \DirectoryIterator("./database/migrations/") as $fileInfo){
50
-            if($fileInfo->isDot()) continue;
49
+        foreach (new \DirectoryIterator("./database/migrations/") as $fileInfo) {
50
+            if ($fileInfo->isDot()) continue;
51 51
 
52
-            if(strpos($fileInfo->getFilename(), $fileName) !== FALSE){
52
+            if (strpos($fileInfo->getFilename(), $fileName) !== FALSE) {
53 53
                 unlink($fileInfo->getPathname());
54 54
             }
55 55
         }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $name = $parts[0]['name'];
93 93
         $parts[1]['args'] = array_merge(["'{$name}'"], $parts[1]['args']);
94 94
         unset($parts[0]);
95
-        $parts = array_map(function($part){
95
+        $parts = array_map(function($part) {
96 96
             return '->' . $part['name'] . '(' . implode(', ', $part['args']) . ')';
97 97
         }, $parts);
98 98
         return "            \$table" . implode('', $parts) . ';';
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 
116 116
     protected function getConstraintDeclaration($key)
117 117
     {
118
-        if(! $key['column']){
118
+        if (!$key['column']) {
119 119
             $key['column'] = 'id';
120 120
         }
121
-        if(! $key['table']){
121
+        if (!$key['table']) {
122 122
             $key['table'] = substr($key['name'], 0, count($key['name']) - 4);
123 123
         }
124 124
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             ])
131 131
             ->get();
132 132
 
133
-        if($key['on_delete']){
133
+        if ($key['on_delete']) {
134 134
             $constraint .= PHP_EOL . $this->getTemplate('migration/on-constraint')
135 135
                     ->with([
136 136
                         'event' => 'Delete',
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     ->get();
140 140
         }
141 141
 
142
-        if($key['on_update']){
142
+        if ($key['on_update']) {
143 143
             $constraint .= PHP_EOL . $this->getTemplate('migration/on-constraint')
144 144
                     ->with([
145 145
                         'event' => 'Update',
Please login to merge, or discard this patch.
src/Commands/ModelCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
     protected function getAsArrayFields($arg, $isOption = true)
51 51
     {
52 52
     	$arg = ($isOption) ? $this->option($arg) : $this->argument($arg);
53
-        if(is_string($arg)){
53
+        if (is_string($arg)) {
54 54
         	$arg = explode(',', $arg);
55
-        } else if(! is_array($arg)) {
55
+        } else if (!is_array($arg)) {
56 56
             $arg = [];
57 57
         }
58
-        return implode(', ', array_map(function($item){
58
+        return implode(', ', array_map(function($item) {
59 59
             return '"' . $item . '"';
60 60
         }, $arg));
61 61
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $this->getRelationsByType('morphedByMany', 'morphed-by-many', false, 'relations-morphMany')
75 75
         );
76 76
 
77
-        if(empty($relations)){
77
+        if (empty($relations)) {
78 78
             return "    // Relationships";
79 79
         }
80 80
 
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $relations = [];
87 87
         $option = $this->option($option);
88
-        if($option){
88
+        if ($option) {
89 89
 
90 90
             $items = $this->getArgumentParser($parser)->parse($option);
91 91
 
92
-            $template = ($withTimestamps) ? 'model/relation-with-timestamps' : ($parser=='relations'?'model/relation':'model/relation-'.$type);
92
+            $template = ($withTimestamps) ? 'model/relation-with-timestamps' : ($parser == 'relations' ? 'model/relation' : 'model/relation-' . $type);
93 93
             $template = $this->getTemplate($template);
94 94
             foreach ($items as $item) {
95 95
                 $item['type'] = $type;
96 96
 				if ($parser == 'relations') {
97 97
 					$item['model'] = $this->prependNamespace($item['model'] ?: $item['name']);
98 98
 				} else if ($parser != 'relations') {
99
-					switch($type) {
99
+					switch ($type) {
100 100
 						case "hasManyThrough":
101
-							if(! $item['through'] && $item['model']){
101
+							if (!$item['through'] && $item['model']) {
102 102
 								$item['through'] = $this->prependNamespace($item['model']);
103 103
 								$item['model'] = $this->prependNamespace($item['name']);
104 104
 							} else {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 						case "morphMany":
110 110
 						case "morphToMany":
111 111
 						case "morphedByMany":
112
-							if(! $item['through']){
112
+							if (!$item['through']) {
113 113
 								$item['through'] = $item['model'];
114 114
 								$item['model'] = $this->prependNamespace($item['name']);
115 115
 							} else {
Please login to merge, or discard this patch.
src/Commands/ControllerCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
     protected $signature = 'wn:controller
8 8
         {model : Name of the model (with namespace if not App)}
9
-        {--path='.ControllerCommand::DEFAULT_PATH.' : where to store the controllers file.}
9
+        {--path='.ControllerCommand::DEFAULT_PATH . ' : where to store the controllers file.}
10 10
         {--no-routes= : without routes}
11 11
         {--routes= : where to store the routes.}
12 12
         {--force= : override the existing files}
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $model = $this->argument('model');
21 21
         $name = '';
22
-        if(strrpos($model, "\\") === false){
22
+        if (strrpos($model, "\\") === false) {
23 23
             $name = $model;
24 24
             $model = "App\\" . $model;
25 25
         } else {
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
                 'name' => $controller,
33 33
                 'model' => $model,
34 34
                 'namespace' => $this->getNamespace(),
35
-                'use' => ($this->getNamespace() != $this->getDefaultNamespace()?'use '.$this->getDefaultNamespace().'\Controller;'.PHP_EOL.'use '.$this->getDefaultNamespace().'\RESTActions;'.PHP_EOL:'')
35
+                'use' => ($this->getNamespace() != $this->getDefaultNamespace() ? 'use ' . $this->getDefaultNamespace() . '\Controller;' . PHP_EOL . 'use ' . $this->getDefaultNamespace() . '\RESTActions;' . PHP_EOL : '')
36 36
             ])
37 37
             ->get();
38 38
 
39 39
         $this->save($content, "./{$this->option('path')}/{$controller}.php", "{$controller}");
40 40
 
41
-        if (! $this->option('no-routes')) {
41
+        if (!$this->option('no-routes')) {
42 42
             $options = [
43 43
                 'resource' => snake_case($name, '-'),
44 44
                 '--controller' => $controller,
Please login to merge, or discard this patch.
src/Commands/ResourceCommand.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
             '--parsed' => true
75 75
         ]);
76 76
 
77
-        if (! $this->option('no-controller')) {
77
+        if (!$this->option('no-controller')) {
78 78
             // generating REST actions trait if doesn't exist
79
-            if(! $this->fs->exists('./app/Http/Controllers/RESTActions.php')){
79
+            if (!$this->fs->exists('./app/Http/Controllers/RESTActions.php')) {
80 80
                 $this->call('wn:controller:rest-actions');
81 81
             }
82 82
 
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 
101 101
         // generating model factory
102 102
         $this->call('wn:factory', [
103
-            'model' => $this->getNamespace().'\\'.$modelName,
104
-            '--file' => './database/factories/'.str_plural($modelName).'.php',
103
+            'model' => $this->getNamespace() . '\\' . $modelName,
104
+            '--file' => './database/factories/' . str_plural($modelName) . '.php',
105 105
             '--fields' => $this->factoryFields(),
106 106
             '--force' => $this->option('force'),
107 107
             '--parsed' => true
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
     protected function parseFields()
118 118
     {
119 119
         $fields = $this->argument('fields');
120
-        if($this->option('parsed')){
120
+        if ($this->option('parsed')) {
121 121
             $this->fields = $fields;
122 122
         } else {
123
-            if(! $fields){
123
+            if (!$fields) {
124 124
                 $this->fields = [];
125 125
             } else {
126 126
                 $this->fields = $this->getArgumentParser('fields')
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                     if ($name['nullable']) {
152 152
                         $return['schema'][] = ['name' => 'nullable', 'args' => []];
153 153
                     } else {
154
-                        $return['rules'] = 'required'.(!empty($return['rules'])?'|'.$return['rules']:'');
154
+                        $return['rules'] = 'required' . (!empty($return['rules']) ? '|' . $return['rules'] : '');
155 155
                     }
156 156
                 } else {
157 157
                     $return['schema'] = [
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
     protected function fieldsHavingTag($tag)
172 172
     {
173
-        return array_map(function($field){
173
+        return array_map(function($field) {
174 174
             return $field['name'];
175 175
         }, array_filter($this->fields, function($field) use($tag){
176 176
             return in_array($tag, $field['tags']);
@@ -179,19 +179,19 @@  discard block
 block discarded – undo
179 179
 
180 180
     protected function rules()
181 181
     {
182
-        return array_map(function($field){
182
+        return array_map(function($field) {
183 183
             return [
184 184
                 'name' => $field['name'],
185 185
                 'rule' => $field['rules']
186 186
             ];
187
-        }, array_filter($this->fields, function($field){
187
+        }, array_filter($this->fields, function($field) {
188 188
             return !empty($field['rules']);
189 189
         }));
190 190
     }
191 191
 
192 192
     protected function schema()
193 193
     {
194
-        return array_map(function($field){
194
+        return array_map(function($field) {
195 195
             return array_merge([[
196 196
                 'name' => $field['name'],
197 197
                 'args' => []
@@ -204,19 +204,19 @@  discard block
 block discarded – undo
204 204
         $belongsTo = $this->option('belongs-to');
205 205
         $morphTo = $this->option('morph-to');
206 206
 
207
-        if(! $belongsTo && (! $withMorph || ! $morphTo)) {
207
+        if (!$belongsTo && (!$withMorph || !$morphTo)) {
208 208
             return [];
209 209
         }
210 210
 
211 211
         $belongsTo = $belongsTo ? $this->getArgumentParser('relations')->parse($belongsTo) : [];
212 212
 
213
-        $belongsTo = array_map(function($relation){
213
+        $belongsTo = array_map(function($relation) {
214 214
             return array("model" => camel_case(str_singular($this->extractClassName($relation['model'] ? $relation['model'] : $relation['name']))), "name" => snake_case(str_singular($this->extractClassName($relation['name']))) . '_id', "type" => "belongsTo");
215 215
         }, $belongsTo);
216 216
 
217 217
         if ($withMorph) {
218 218
             $morphTo = $morphTo ? $this->getArgumentParser('relations-morphTo')->parse($morphTo) : [];
219
-            $morphTo = array_map(function($relation){
219
+            $morphTo = array_map(function($relation) {
220 220
                 $name = snake_case(str_singular($relation['name']));
221 221
                 return array(array("name" => $name . '_id', "type" => "morphTo", "nullable" => $relation['nullable']), array("name" => $name . '_type', "type" => "morphTo", "nullable" => $relation['nullable']));
222 222
             }, $morphTo);
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
 
246 246
     protected function factoryFields()
247 247
     {
248
-        return array_map(function($field){
248
+        return array_map(function($field) {
249 249
             return [
250 250
                 'name' => $field['name'],
251 251
                 'type' => $field['factory']
252 252
             ];
253
-        }, array_filter($this->fields, function($field){
253
+        }, array_filter($this->fields, function($field) {
254 254
             return isset($field['factory']) && $field['factory'];
255 255
         }));
256 256
     }
Please login to merge, or discard this patch.