Completed
Push — master ( dafa7f...014c61 )
by Amine
12s
created
lumen-test/tests/_support/_generated/FunctionalTesterActions.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,6 @@
 block discarded – undo
5 5
 // You should not change it manually as it will be overwritten on next build
6 6
 // @codingStandardsIgnoreFile
7 7
 
8
-use Helper\Functional;
9
-
10 8
 trait FunctionalTesterActions
11 9
 {
12 10
     /**
Please login to merge, or discard this patch.
src/Commands/ResourcesCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
         $content = Yaml::parse($content);
22 22
 
23 23
         $modelIndex = 0;
24
-        foreach ($content as $model => $i){
24
+        foreach ($content as $model => $i) {
25 25
             $i = $this->getResourceParams($model, $i);
26
-            $migrationName = 'Create' .  ucwords(str_plural($i['name']));
27
-            $migrationFile = date('Y_m_d_His') . '-' . str_pad($modelIndex , 3, 0, STR_PAD_LEFT) . '_' . snake_case($migrationName) . '_table';
26
+            $migrationName = 'Create' . ucwords(str_plural($i['name']));
27
+            $migrationFile = date('Y_m_d_His') . '-' . str_pad($modelIndex, 3, 0, STR_PAD_LEFT) . '_' . snake_case($migrationName) . '_table';
28 28
 
29 29
 
30 30
             $this->call('wn:resource', [
@@ -70,34 +70,34 @@  discard block
 block discarded – undo
70 70
     {
71 71
         $i['name'] = snake_case($modelName);
72 72
 
73
-        foreach(['hasMany', 'hasOne', 'add', 'belongsTo', 'belongsToMany'] as $relation){
74
-            if(isset($i[$relation])){
73
+        foreach (['hasMany', 'hasOne', 'add', 'belongsTo', 'belongsToMany'] as $relation) {
74
+            if (isset($i[$relation])) {
75 75
                 $i[$relation] = $this->convertArray($i[$relation], ' ', ',');
76 76
             } else {
77 77
                 $i[$relation] = false;
78 78
             }
79 79
         }
80 80
 
81
-        if($i['belongsToMany']){
81
+        if ($i['belongsToMany']) {
82 82
             $relations = $this->getArgumentParser('relations')->parse($i['belongsToMany']);
83
-            foreach ($relations as $relation){
83
+            foreach ($relations as $relation) {
84 84
                 $table = '';
85 85
 
86
-                if(! $relation['model']){
86
+                if (!$relation['model']) {
87 87
                     $table = snake_case($relation['name']);
88 88
                 } else {
89 89
                     $names = array_reverse(explode("\\", $relation['model']));
90 90
                     $table = snake_case($names[0]);
91 91
                 }
92 92
 
93
-                $tables = [ str_singular($table), $i['name'] ];
93
+                $tables = [str_singular($table), $i['name']];
94 94
                 sort($tables);
95 95
                 $this->pivotTables[] = $tables;
96 96
             }
97 97
         }
98 98
 
99 99
         $fields = [];
100
-        foreach($i['fields'] as $name => $value) {
100
+        foreach ($i['fields'] as $name => $value) {
101 101
             $value['name'] = $name;
102 102
             $fields[] = $this->serializeField($value);
103 103
         }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
         $string = "{$name};{$schema};{$rules};{$tags}";
120 120
 
121
-        if(isset($field['factory']) && !empty($field['factory'])){
121
+        if (isset($field['factory']) && !empty($field['factory'])) {
122 122
             $string .= ';' . $field['factory'];
123 123
         }
124 124
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     protected function convertArray($list, $old, $new)
129 129
     {
130
-        return implode($new, array_filter(explode($old, $list), function($item){
130
+        return implode($new, array_filter(explode($old, $list), function($item) {
131 131
             return !empty($item);
132 132
         }));
133 133
     }
Please login to merge, or discard this patch.