@@ -5,7 +5,6 @@ |
||
5 | 5 | // You should not change it manually as it will be overwritten on next build |
6 | 6 | // @codingStandardsIgnoreFile |
7 | 7 | |
8 | -use Helper\Acceptance; |
|
9 | 8 | use Codeception\Module\Cli; |
10 | 9 | use Codeception\Module\Filesystem; |
11 | 10 |
@@ -6,7 +6,6 @@ |
||
6 | 6 | // @codingStandardsIgnoreFile |
7 | 7 | |
8 | 8 | use Codeception\Module\Asserts; |
9 | -use Helper\Unit; |
|
10 | 9 | |
11 | 10 | trait UnitTesterActions |
12 | 11 | { |
@@ -21,16 +21,25 @@ discard block |
||
21 | 21 | $this->argumentFormatLoader = new ArgumentFormatLoader($fs); |
22 | 22 | } |
23 | 23 | |
24 | + /** |
|
25 | + * @param string $name |
|
26 | + */ |
|
24 | 27 | protected function getTemplate($name) |
25 | 28 | { |
26 | 29 | return $this->templates->load($name); |
27 | 30 | } |
28 | 31 | |
32 | + /** |
|
33 | + * @param string $name |
|
34 | + */ |
|
29 | 35 | protected function getArgumentParser($name){ |
30 | 36 | $format = $this->argumentFormatLoader->load($name); |
31 | 37 | return new ArgumentParser($format); |
32 | 38 | } |
33 | 39 | |
40 | + /** |
|
41 | + * @param string $content |
|
42 | + */ |
|
34 | 43 | protected function save($content, $path, $name, $force = false) |
35 | 44 | { |
36 | 45 | if (!$force && $this->fs->exists($path) && $this->input->hasOption('force') && !$this->option('force')) { |
@@ -49,6 +58,9 @@ discard block |
||
49 | 58 | } |
50 | 59 | } |
51 | 60 | |
61 | + /** |
|
62 | + * @param integer $n |
|
63 | + */ |
|
52 | 64 | protected function spaces($n) |
53 | 65 | { |
54 | 66 | return str_repeat(' ', $n); |
@@ -10,10 +10,10 @@ |
||
10 | 10 | class BaseCommand extends Command { |
11 | 11 | |
12 | 12 | protected $fs; |
13 | - protected $templates; |
|
13 | + protected $templates; |
|
14 | 14 | |
15 | - public function __construct(Filesystem $fs) |
|
16 | - { |
|
15 | + public function __construct(Filesystem $fs) |
|
16 | + { |
|
17 | 17 | parent::__construct(); |
18 | 18 | |
19 | 19 | $this->fs = $fs; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | return $this->templates->load($name); |
27 | 27 | } |
28 | 28 | |
29 | - protected function getArgumentParser($name){ |
|
29 | + protected function getArgumentParser($name) { |
|
30 | 30 | $format = $this->argumentFormatLoader->load($name); |
31 | 31 | return new ArgumentParser($format); |
32 | 32 | } |
@@ -111,6 +111,9 @@ |
||
111 | 111 | |
112 | 112 | } |
113 | 113 | |
114 | + /** |
|
115 | + * @param string $tag |
|
116 | + */ |
|
114 | 117 | protected function fieldsHavingTag($tag) |
115 | 118 | { |
116 | 119 | return array_map(function($field){ |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | ]); |
58 | 58 | |
59 | 59 | // generating REST actions trait if doesn't exist |
60 | - if(! $this->fs->exists('./app/Http/Controllers/RESTActions.php')){ |
|
60 | + if (!$this->fs->exists('./app/Http/Controllers/RESTActions.php')) { |
|
61 | 61 | $this->call('wn:controller:rest-actions'); |
62 | 62 | } |
63 | 63 | |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | protected function parseFields() |
87 | 87 | { |
88 | 88 | $fields = $this->argument('fields'); |
89 | - if($this->option('parsed')){ |
|
89 | + if ($this->option('parsed')) { |
|
90 | 90 | $this->fields = $fields; |
91 | 91 | } else { |
92 | - if(! $fields){ |
|
92 | + if (!$fields) { |
|
93 | 93 | $this->fields = []; |
94 | 94 | } else { |
95 | 95 | $this->fields = $this->getArgumentParser('fields') |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | protected function fieldsHavingTag($tag) |
115 | 115 | { |
116 | - return array_map(function($field){ |
|
116 | + return array_map(function($field) { |
|
117 | 117 | return $field['name']; |
118 | 118 | }, array_filter($this->fields, function($field) use($tag){ |
119 | 119 | return in_array($tag, $field['tags']); |
@@ -122,19 +122,19 @@ discard block |
||
122 | 122 | |
123 | 123 | protected function rules() |
124 | 124 | { |
125 | - return array_map(function($field){ |
|
125 | + return array_map(function($field) { |
|
126 | 126 | return [ |
127 | 127 | 'name' => $field['name'], |
128 | 128 | 'rule' => $field['rules'] |
129 | 129 | ]; |
130 | - }, array_filter($this->fields, function($field){ |
|
130 | + }, array_filter($this->fields, function($field) { |
|
131 | 131 | return !empty($field['rules']); |
132 | 132 | })); |
133 | 133 | } |
134 | 134 | |
135 | 135 | protected function schema() |
136 | 136 | { |
137 | - return array_map(function($field){ |
|
137 | + return array_map(function($field) { |
|
138 | 138 | return array_merge([[ |
139 | 139 | 'name' => $field['name'], |
140 | 140 | 'args' => [] |
@@ -145,14 +145,14 @@ discard block |
||
145 | 145 | protected function foreignKeys() |
146 | 146 | { |
147 | 147 | $belongsTo = $this->option('belongs-to'); |
148 | - if(! $belongsTo) { |
|
148 | + if (!$belongsTo) { |
|
149 | 149 | return []; |
150 | 150 | } |
151 | 151 | $relations = $this->getArgumentParser('relations')->parse($belongsTo); |
152 | - return array_map(function($relation){ |
|
152 | + return array_map(function($relation) { |
|
153 | 153 | $name = $relation['model'] ? $relation['model'] : $relation['name']; |
154 | 154 | $index = strrpos($name, "\\"); |
155 | - if($index) { |
|
155 | + if ($index) { |
|
156 | 156 | $name = substr($name, $index + 1); |
157 | 157 | } |
158 | 158 | return snake_case(str_singular($name)) . '_id'; |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | |
174 | 174 | protected function factoryFields() |
175 | 175 | { |
176 | - return array_map(function($field){ |
|
176 | + return array_map(function($field) { |
|
177 | 177 | return [ |
178 | 178 | 'name' => $field['name'], |
179 | 179 | 'type' => $field['factory'] |
180 | 180 | ]; |
181 | - }, array_filter($this->fields, function($field){ |
|
181 | + }, array_filter($this->fields, function($field) { |
|
182 | 182 | return isset($field['factory']) && $field['factory']; |
183 | 183 | })); |
184 | 184 | } |
@@ -135,6 +135,10 @@ |
||
135 | 135 | return $string; |
136 | 136 | } |
137 | 137 | |
138 | + /** |
|
139 | + * @param string $old |
|
140 | + * @param string $new |
|
141 | + */ |
|
138 | 142 | protected function convertArray($list, $old, $new) |
139 | 143 | { |
140 | 144 | return implode($new, array_filter(explode($old, $list), function($item){ |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $content = $this->fs->get($this->argument('file')); |
21 | 21 | $content = Yaml::parse($content); |
22 | 22 | |
23 | - foreach ($content as $model => $i){ |
|
23 | + foreach ($content as $model => $i) { |
|
24 | 24 | $i = $this->getResourceParams($model, $i); |
25 | 25 | |
26 | 26 | $this->call('wn:resource', [ |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | { |
65 | 65 | $i['name'] = snake_case($modelName); |
66 | 66 | |
67 | - foreach(['hasMany', 'hasOne', 'add', 'belongsTo', 'belongsToMany'] as $relation){ |
|
68 | - if(isset($i[$relation])){ |
|
67 | + foreach (['hasMany', 'hasOne', 'add', 'belongsTo', 'belongsToMany'] as $relation) { |
|
68 | + if (isset($i[$relation])) { |
|
69 | 69 | $i[$relation] = $this->convertArray($i[$relation], ' ', ','); |
70 | 70 | } else { |
71 | 71 | $i[$relation] = false; |
@@ -91,26 +91,26 @@ discard block |
||
91 | 91 | // } |
92 | 92 | // } |
93 | 93 | |
94 | - if($i['belongsToMany']){ |
|
94 | + if ($i['belongsToMany']) { |
|
95 | 95 | $relations = $this->getArgumentParser('relations')->parse($i['belongsToMany']); |
96 | - foreach ($relations as $relation){ |
|
96 | + foreach ($relations as $relation) { |
|
97 | 97 | $table = ''; |
98 | 98 | |
99 | - if(! $relation['model']){ |
|
99 | + if (!$relation['model']) { |
|
100 | 100 | $table = snake_case($relation['name']); |
101 | 101 | } else { |
102 | 102 | $names = array_reverse(explode("\\", $relation['model'])); |
103 | 103 | $table = snake_case($names[0]); |
104 | 104 | } |
105 | 105 | |
106 | - $tables = [ str_singular($table), $i['name'] ]; |
|
106 | + $tables = [str_singular($table), $i['name']]; |
|
107 | 107 | sort($tables); |
108 | 108 | $this->pivotTables[] = $tables; |
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | 112 | $fields = []; |
113 | - foreach($i['fields'] as $name => $value) { |
|
113 | + foreach ($i['fields'] as $name => $value) { |
|
114 | 114 | $value['name'] = $name; |
115 | 115 | $fields[] = $this->serializeField($value); |
116 | 116 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | $string = "{$name};{$schema};{$rules};{$tags}"; |
130 | 130 | |
131 | - if(isset($field['factory']) && !empty($field['factory'])){ |
|
131 | + if (isset($field['factory']) && !empty($field['factory'])) { |
|
132 | 132 | $string .= ';' . $field['factory']; |
133 | 133 | } |
134 | 134 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | protected function convertArray($list, $old, $new) |
139 | 139 | { |
140 | - return implode($new, array_filter(explode($old, $list), function($item){ |
|
140 | + return implode($new, array_filter(explode($old, $list), function($item) { |
|
141 | 141 | return !empty($item); |
142 | 142 | })); |
143 | 143 | } |
@@ -19,11 +19,11 @@ |
||
19 | 19 | |
20 | 20 | public function load($name) |
21 | 21 | { |
22 | - if(! isset($this->loaded[$name])){ |
|
22 | + if (!isset($this->loaded[$name])) { |
|
23 | 23 | $path = __DIR__ . "/../../templates/{$name}.wnt"; |
24 | 24 | try { |
25 | 25 | $this->loaded[$name] = $this->fs->get($path); |
26 | - } catch(\Exception $e) { |
|
26 | + } catch (\Exception $e) { |
|
27 | 27 | throw new TemplateException("Unable to read the file '{$path}'"); |
28 | 28 | } |
29 | 29 | } |
@@ -7,27 +7,27 @@ |
||
7 | 7 | |
8 | 8 | class TemplateLoader { |
9 | 9 | |
10 | - protected $fs; |
|
10 | + protected $fs; |
|
11 | 11 | |
12 | - protected $loaded; |
|
12 | + protected $loaded; |
|
13 | 13 | |
14 | - public function __construct(Filesystem $fs) |
|
15 | - { |
|
16 | - $this->fs = $fs; |
|
17 | - $this->loaded = []; |
|
18 | - } |
|
14 | + public function __construct(Filesystem $fs) |
|
15 | + { |
|
16 | + $this->fs = $fs; |
|
17 | + $this->loaded = []; |
|
18 | + } |
|
19 | 19 | |
20 | - public function load($name) |
|
21 | - { |
|
22 | - if(! isset($this->loaded[$name])){ |
|
23 | - $path = __DIR__ . "/../../templates/{$name}.wnt"; |
|
24 | - try { |
|
25 | - $this->loaded[$name] = $this->fs->get($path); |
|
26 | - } catch(\Exception $e) { |
|
27 | - throw new TemplateException("Unable to read the file '{$path}'"); |
|
28 | - } |
|
29 | - } |
|
30 | - return new Template($this, $this->loaded[$name]); |
|
31 | - } |
|
20 | + public function load($name) |
|
21 | + { |
|
22 | + if(! isset($this->loaded[$name])){ |
|
23 | + $path = __DIR__ . "/../../templates/{$name}.wnt"; |
|
24 | + try { |
|
25 | + $this->loaded[$name] = $this->fs->get($path); |
|
26 | + } catch(\Exception $e) { |
|
27 | + throw new TemplateException("Unable to read the file '{$path}'"); |
|
28 | + } |
|
29 | + } |
|
30 | + return new Template($this, $this->loaded[$name]); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | public function with($data = []) |
35 | 35 | { |
36 | - if($data) |
|
36 | + if ($data) |
|
37 | 37 | $this->dirty = true; |
38 | 38 | foreach ($data as $key => $value) { |
39 | 39 | $this->data[$key] = $value; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function get() |
45 | 45 | { |
46 | - if($this->dirty){ |
|
46 | + if ($this->dirty) { |
|
47 | 47 | $this->compile(); |
48 | 48 | $this->dirty = false; |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function compile() |
54 | 54 | { |
55 | 55 | $this->compiled = $this->text; |
56 | - foreach($this->data as $key => $value){ |
|
56 | + foreach ($this->data as $key => $value) { |
|
57 | 57 | $this->compiled = str_replace('{{' . $key . '}}', $value, $this->compiled); |
58 | 58 | } |
59 | 59 | return $this; |
@@ -33,8 +33,9 @@ |
||
33 | 33 | |
34 | 34 | public function with($data = []) |
35 | 35 | { |
36 | - if($data) |
|
37 | - $this->dirty = true; |
|
36 | + if($data) { |
|
37 | + $this->dirty = true; |
|
38 | + } |
|
38 | 39 | foreach ($data as $key => $value) { |
39 | 40 | $this->data[$key] = $value; |
40 | 41 | } |
@@ -5,58 +5,58 @@ |
||
5 | 5 | |
6 | 6 | class Template { |
7 | 7 | |
8 | - protected $loader; |
|
9 | - |
|
10 | - protected $text; |
|
11 | - |
|
12 | - protected $data; |
|
13 | - |
|
14 | - protected $compiled; |
|
15 | - |
|
16 | - protected $dirty; |
|
17 | - |
|
18 | - public function __construct(TemplateLoader $loader, $text) |
|
19 | - { |
|
20 | - $this->loader = $loader; |
|
21 | - $this->text = $text; |
|
22 | - $this->compiled = ''; |
|
23 | - $this->data = []; |
|
24 | - $this->dirty = true; |
|
25 | - } |
|
26 | - |
|
27 | - public function clean() |
|
28 | - { |
|
29 | - $this->data = []; |
|
30 | - $this->dirty = false; |
|
31 | - return $this; |
|
32 | - } |
|
33 | - |
|
34 | - public function with($data = []) |
|
35 | - { |
|
36 | - if($data) |
|
37 | - $this->dirty = true; |
|
38 | - foreach ($data as $key => $value) { |
|
39 | - $this->data[$key] = $value; |
|
40 | - } |
|
41 | - return $this; |
|
42 | - } |
|
43 | - |
|
44 | - public function get() |
|
45 | - { |
|
46 | - if($this->dirty){ |
|
47 | - $this->compile(); |
|
48 | - $this->dirty = false; |
|
49 | - } |
|
50 | - return $this->compiled; |
|
51 | - } |
|
52 | - |
|
53 | - public function compile() |
|
54 | - { |
|
55 | - $this->compiled = $this->text; |
|
56 | - foreach($this->data as $key => $value){ |
|
57 | - $this->compiled = str_replace('{{' . $key . '}}', $value, $this->compiled); |
|
58 | - } |
|
59 | - return $this; |
|
60 | - } |
|
8 | + protected $loader; |
|
9 | + |
|
10 | + protected $text; |
|
11 | + |
|
12 | + protected $data; |
|
13 | + |
|
14 | + protected $compiled; |
|
15 | + |
|
16 | + protected $dirty; |
|
17 | + |
|
18 | + public function __construct(TemplateLoader $loader, $text) |
|
19 | + { |
|
20 | + $this->loader = $loader; |
|
21 | + $this->text = $text; |
|
22 | + $this->compiled = ''; |
|
23 | + $this->data = []; |
|
24 | + $this->dirty = true; |
|
25 | + } |
|
26 | + |
|
27 | + public function clean() |
|
28 | + { |
|
29 | + $this->data = []; |
|
30 | + $this->dirty = false; |
|
31 | + return $this; |
|
32 | + } |
|
33 | + |
|
34 | + public function with($data = []) |
|
35 | + { |
|
36 | + if($data) |
|
37 | + $this->dirty = true; |
|
38 | + foreach ($data as $key => $value) { |
|
39 | + $this->data[$key] = $value; |
|
40 | + } |
|
41 | + return $this; |
|
42 | + } |
|
43 | + |
|
44 | + public function get() |
|
45 | + { |
|
46 | + if($this->dirty){ |
|
47 | + $this->compile(); |
|
48 | + $this->dirty = false; |
|
49 | + } |
|
50 | + return $this->compiled; |
|
51 | + } |
|
52 | + |
|
53 | + public function compile() |
|
54 | + { |
|
55 | + $this->compiled = $this->text; |
|
56 | + foreach($this->data as $key => $value){ |
|
57 | + $this->compiled = str_replace('{{' . $key . '}}', $value, $this->compiled); |
|
58 | + } |
|
59 | + return $this; |
|
60 | + } |
|
61 | 61 | |
62 | 62 | } |
@@ -3,11 +3,11 @@ |
||
3 | 3 | |
4 | 4 | class RouteCommand extends BaseCommand { |
5 | 5 | |
6 | - protected $signature = 'wn:route |
|
6 | + protected $signature = 'wn:route |
|
7 | 7 | {resource : Name of the resource.} |
8 | 8 | {--controller= : Name of the RESTful controller.}'; |
9 | 9 | |
10 | - protected $description = 'Generates RESTful routes.'; |
|
10 | + protected $description = 'Generates RESTful routes.'; |
|
11 | 11 | |
12 | 12 | public function handle() |
13 | 13 | { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $resource = $this->argument('resource'); |
15 | 15 | |
16 | 16 | $routesPath = './routes/web.php'; |
17 | - if (! $this->fs->exists($routesPath)) |
|
17 | + if (!$this->fs->exists($routesPath)) |
|
18 | 18 | $routesPath = './app/Http/routes.php'; |
19 | 19 | |
20 | 20 | $content = $this->fs->get($routesPath); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | protected function getController() |
33 | 33 | { |
34 | 34 | $controller = $this->option('controller'); |
35 | - if(! $controller){ |
|
35 | + if (!$controller) { |
|
36 | 36 | $controller = ucwords(str_plural(camel_case($this->argument('resource')))) . 'Controller'; |
37 | 37 | } |
38 | 38 | return $controller; |
@@ -14,8 +14,9 @@ |
||
14 | 14 | $resource = $this->argument('resource'); |
15 | 15 | |
16 | 16 | $routesPath = './routes/web.php'; |
17 | - if (! $this->fs->exists($routesPath)) |
|
18 | - $routesPath = './app/Http/routes.php'; |
|
17 | + if (! $this->fs->exists($routesPath)) { |
|
18 | + $routesPath = './app/Http/routes.php'; |
|
19 | + } |
|
19 | 20 | |
20 | 21 | $content = $this->fs->get($routesPath); |
21 | 22 |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | |
4 | 4 | class ModelCommand extends BaseCommand { |
5 | 5 | |
6 | - protected $signature = 'wn:model |
|
6 | + protected $signature = 'wn:model |
|
7 | 7 | {name : Name of the model.} |
8 | 8 | {--fillable= : the fillable fields.} |
9 | 9 | {--dates= : date fields.} |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | {--force= : override the existing files} |
19 | 19 | '; |
20 | 20 | |
21 | - protected $description = 'Generates a model class for a RESTfull resource'; |
|
21 | + protected $description = 'Generates a model class for a RESTfull resource'; |
|
22 | 22 | |
23 | 23 | public function handle() |
24 | 24 | { |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | |
43 | 43 | protected function getAsArrayFields($arg, $isOption = true) |
44 | 44 | { |
45 | - $arg = ($isOption) ? $this->option($arg) : $this->argument($arg); |
|
45 | + $arg = ($isOption) ? $this->option($arg) : $this->argument($arg); |
|
46 | 46 | if(is_string($arg)){ |
47 | - $arg = explode(',', $arg); |
|
47 | + $arg = explode(',', $arg); |
|
48 | 48 | } else if(! is_array($arg)) { |
49 | 49 | $arg = []; |
50 | 50 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | protected function getNamespace() |
57 | 57 | { |
58 | - return str_replace(' ', '\\', ucwords(str_replace('/', ' ', $this->option('path')))); |
|
58 | + return str_replace(' ', '\\', ucwords(str_replace('/', ' ', $this->option('path')))); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | protected function getRelations() |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | protected function getAsArrayFields($arg, $isOption = true) |
44 | 44 | { |
45 | 45 | $arg = ($isOption) ? $this->option($arg) : $this->argument($arg); |
46 | - if(is_string($arg)){ |
|
46 | + if (is_string($arg)) { |
|
47 | 47 | $arg = explode(',', $arg); |
48 | - } else if(! is_array($arg)) { |
|
48 | + } else if (!is_array($arg)) { |
|
49 | 49 | $arg = []; |
50 | 50 | } |
51 | - return implode(', ', array_map(function($item){ |
|
51 | + return implode(', ', array_map(function($item) { |
|
52 | 52 | return '"' . $item . '"'; |
53 | 53 | }, $arg)); |
54 | 54 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $this->getRelationsByType('belongsToMany', 'belongs-to-many', true) |
68 | 68 | ); |
69 | 69 | |
70 | - if(empty($relations)){ |
|
70 | + if (empty($relations)) { |
|
71 | 71 | return " // Relationships"; |
72 | 72 | } |
73 | 73 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $relations = []; |
80 | 80 | $option = $this->option($option); |
81 | - if($option){ |
|
81 | + if ($option) { |
|
82 | 82 | |
83 | 83 | $items = $this->getArgumentParser('relations')->parse($option); |
84 | 84 | |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | $template = $this->getTemplate($template); |
87 | 87 | foreach ($items as $item) { |
88 | 88 | $item['type'] = $type; |
89 | - if(! $item['model']){ |
|
89 | + if (!$item['model']) { |
|
90 | 90 | $item['model'] = $this->getNamespace() . '\\' . ucwords(str_singular($item['name'])); |
91 | - } else if(strpos($item['model'], '\\') === false ){ |
|
91 | + } else if (strpos($item['model'], '\\') === false) { |
|
92 | 92 | $item['model'] = $this->getNamespace() . '\\' . $item['model']; |
93 | 93 | } |
94 | 94 | $relations[] = $template->with($item)->get(); |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | protected function getRules() |
101 | 101 | { |
102 | 102 | $rules = $this->option('rules'); |
103 | - if(! $rules){ |
|
103 | + if (!$rules) { |
|
104 | 104 | return " // Validation rules"; |
105 | 105 | } |
106 | 106 | $items = $rules; |
107 | - if(! $this->option('parsed')){ |
|
107 | + if (!$this->option('parsed')) { |
|
108 | 108 | $items = $this->getArgumentParser('rules')->parse($rules); |
109 | 109 | } |
110 | 110 | $rules = []; |