Completed
Pull Request — master (#66)
by
unknown
01:43
created
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/BaseCommand.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@  discard block
 block discarded – undo
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;
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 
57 57
     protected function getNamespace($path = false)
58 58
     {
59
-		if (! $path) {
60
-			$path = $this->option('path');
61
-		}
59
+        if (! $path) {
60
+            $path = $this->option('path');
61
+        }
62 62
 
63
-    	return str_replace(' ', '\\', ucwords(trim(str_replace('/', ' ', $path))));
63
+        return str_replace(' ', '\\', ucwords(trim(str_replace('/', ' ', $path))));
64 64
     }
65 65
 
66 66
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
     protected function getNamespace($path = false)
58 58
     {
59
-		if (! $path) {
59
+		if (!$path) {
60 60
 			$path = $this->option('path');
61 61
 		}
62 62
 
Please login to merge, or discard this patch.
src/Commands/MorphTableCommand.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 class MorphTableCommand extends BaseCommand {
5 5
 
6
-	protected $signature = 'wn:morph-table
6
+    protected $signature = 'wn:morph-table
7 7
         {model : Name of the persistant model or table}
8 8
         {morphable : Name of the morphable identifier}
9 9
         {--add= : specifies additional columns like timestamps, softDeletes, rememberToken and nullableTimestamps.}
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
         {--force= : override the existing files}
12 12
     ';
13 13
 
14
-	protected $description = 'Generates creation migration for a morphable pivot table';
14
+    protected $description = 'Generates creation migration for a morphable pivot table';
15 15
 
16 16
     protected $fields;
17 17
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     protected function keys()
49 49
     {
50 50
         // return implode(' ', $this->fields);
51
-		return snake_case(str_singular($this->argument('model')))."_id";
51
+        return snake_case(str_singular($this->argument('model')))."_id";
52 52
     }
53 53
 
54 54
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
     protected function parseFields()
34 34
     {
35 35
         $this->fields = array_map(function($arg, $app) {
36
-            return snake_case(str_singular($this->argument($arg)))."_".$app;
36
+            return snake_case(str_singular($this->argument($arg))) . "_" . $app;
37 37
         }, ['model', 'morphable', 'morphable'], ['id', 'id', 'type']);
38 38
 
39 39
     }
40 40
 
41 41
     protected function schema()
42 42
     {
43
-        return implode(' ', array_map(function($field){
43
+        return implode(' ', array_map(function($field) {
44 44
             return $field . ':' . (substr($field, -3) == '_id' ? 'integer:unsigned' : 'string.50') . ':index';
45 45
         }, $this->fields));
46 46
     }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     protected function keys()
49 49
     {
50 50
         // return implode(' ', $this->fields);
51
-		return snake_case(str_singular($this->argument('model')))."_id";
51
+		return snake_case(str_singular($this->argument('model'))) . "_id";
52 52
     }
53 53
 
54 54
 }
Please login to merge, or discard this patch.