Passed
Push — main ( 81385b...4fd2d8 )
by ikechukwu
03:07
created
src/Console/Commands/MagicModelCommand.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Symfony\Component\Console\Attribute\AsCommand;
8 8
 use Symfony\Component\Console\Input\InputOption;
9 9
 
10
-#[AsCommand(name: 'magic:model')]
10
+#[AsCommand(name: 'magic:model') ]
11 11
 class MagicModelCommand extends GeneratorCommand
12 12
 {
13 13
     /**
@@ -56,56 +56,56 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $ary = explode("\\", $name);
59
-        $model = $ary[count($ary) - 1];
59
+        $model = $ary[ count($ary) - 1 ];
60 60
         $modelVariable = lcfirst($model);
61 61
         $modelUnderScore = Str::snake($modelVariable);
62 62
 
63
-        $this->callSilently("make:migration", ['name' => "create_{$modelUnderScore}s_table"]);
63
+        $this->callSilently("make:migration", [ 'name' => "create_{$modelUnderScore}s_table" ]);
64 64
         $this->components->info("Migration scaffolding for {$model} model generated successfully.");
65 65
 
66
-        $this->callSilently("magic:contract", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
66
+        $this->callSilently("magic:contract", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
67 67
         $this->components->info("Magic contract scaffolding for {$model} model generated successfully.");
68 68
 
69
-        $this->callSilently("magic:repository", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
69
+        $this->callSilently("magic:repository", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
70 70
         $this->components->info("Magic repository scaffolding for {$model} model generated successfully.");
71 71
 
72
-        $this->callSilently("magic:service", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
72
+        $this->callSilently("magic:service", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
73 73
         $this->components->info("Magic service scaffolding for {$model} model generated successfully.");
74 74
 
75
-        $this->callSilently("magic:controller", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
75
+        $this->callSilently("magic:controller", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
76 76
         $this->components->info("Magic controller scaffolding for {$model} model generated successfully.");
77 77
 
78
-        $this->callSilently("magic:createRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
78
+        $this->callSilently("magic:createRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
79 79
         $this->components->info("Magic create request scaffolding for {$model} model generated successfully.");
80 80
 
81
-        $this->callSilently("magic:updateRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
81
+        $this->callSilently("magic:updateRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
82 82
         $this->components->info("Magic update request scaffolding for {$model} model generated successfully.");
83 83
 
84
-        $this->callSilently("magic:deleteRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
84
+        $this->callSilently("magic:deleteRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
85 85
         $this->components->info("Magic delete request scaffolding for {$model} model generated successfully.");
86 86
 
87
-        $this->callSilently("magic:readRequest", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
87
+        $this->callSilently("magic:readRequest", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
88 88
         $this->components->info("Magic read request scaffolding for {$model} model generated successfully.");
89 89
 
90
-        $this->callSilently("magic:api", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
90
+        $this->callSilently("magic:api", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
91 91
         $this->components->info("Magic api route scaffolding for {$model} model generated successfully.");
92 92
 
93
-        $this->callSilently("magic:test", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
93
+        $this->callSilently("magic:test", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
94 94
         $this->components->info("Magic test scaffolding for {$model} model generated successfully.");
95 95
 
96
-        $this->callSilently("magic:factory", ['name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore]);
96
+        $this->callSilently("magic:factory", [ 'name' => "{$model}", '--variable' => $modelVariable, '--underscore' => $modelUnderScore ]);
97 97
         $this->components->info("Magic factory scaffolding for {$model} model generated successfully.");
98 98
 
99 99
         $stub = str_replace(
100
-            ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name)
100
+            [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name)
101 101
         );
102 102
 
103 103
         $stub = str_replace(
104
-            ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub
104
+            [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub
105 105
         );
106 106
 
107 107
         return str_replace(
108
-            ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub
108
+            [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub
109 109
         );
110 110
     }
111 111
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     protected function getOptions()
164 164
     {
165 165
         return [
166
-            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the model already exists'],
166
+            [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the model already exists' ],
167 167
         ];
168 168
     }
169 169
 }
Please login to merge, or discard this patch.
src/Console/Commands/MagicContractCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Symfony\Component\Console\Attribute\AsCommand;
8 8
 use Symfony\Component\Console\Input\InputOption;
9 9
 
10
-#[AsCommand(name: 'magic:contract')]
10
+#[AsCommand(name: 'magic:contract') ]
11 11
 class MagicContractCommand extends GeneratorCommand
12 12
 {
13 13
     /**
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $ary = explode("\\", $name);
59
-        $model = $ary[count($ary) - 1];
59
+        $model = $ary[ count($ary) - 1 ];
60 60
         $modelVariable = $this->option('variable');
61 61
         $modelUnderScore = $this->option('underscore');
62 62
         $name = "{$name}RepositoryInterface";
63 63
 
64 64
         $stub = str_replace(
65
-            ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name)
65
+            [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name)
66 66
         );
67 67
 
68 68
         $stub = str_replace(
69
-            ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub
69
+            [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub
70 70
         );
71 71
 
72 72
         return str_replace(
73
-            ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub
73
+            [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub
74 74
         );
75 75
 
76 76
     }
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     protected function getOptions()
130 130
     {
131 131
         return [
132
-            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the contract already exists'],
133
-            ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this contract class'],
134
-            ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this contract class'],
132
+            [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the contract already exists' ],
133
+            [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this contract class' ],
134
+            [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this contract class' ],
135 135
         ];
136 136
     }
137 137
 
@@ -146,6 +146,6 @@  discard block
 block discarded – undo
146 146
         $name = "{$name}RepositoryInterface";
147 147
         $name = Str::replaceFirst($this->rootNamespace(), '', $name);
148 148
 
149
-        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
149
+        return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php';
150 150
     }
151 151
 }
Please login to merge, or discard this patch.
src/Console/Commands/MagicServiceCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Symfony\Component\Console\Attribute\AsCommand;
8 8
 use Symfony\Component\Console\Input\InputOption;
9 9
 
10
-#[AsCommand(name: 'magic:service')]
10
+#[AsCommand(name: 'magic:service') ]
11 11
 class MagicServiceCommand extends GeneratorCommand
12 12
 {
13 13
     /**
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $ary = explode("\\", $name);
59
-        $model = $ary[count($ary) - 1];
59
+        $model = $ary[ count($ary) - 1 ];
60 60
         $modelVariable = $this->option('variable');
61 61
         $modelUnderScore = $this->option('underscore');
62 62
         $name = "{$name}Service";
63 63
 
64 64
         $stub = str_replace(
65
-            ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name)
65
+            [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name)
66 66
         );
67 67
 
68 68
         $stub = str_replace(
69
-            ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub
69
+            [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub
70 70
         );
71 71
 
72 72
         return str_replace(
73
-            ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub
73
+            [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub
74 74
         );
75 75
 
76 76
     }
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     protected function getOptions()
130 130
     {
131 131
         return [
132
-            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the service already exists'],
133
-            ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this service class'],
134
-            ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this service class'],
132
+            [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the service already exists' ],
133
+            [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this service class' ],
134
+            [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this service class' ],
135 135
         ];
136 136
     }
137 137
 
@@ -146,6 +146,6 @@  discard block
 block discarded – undo
146 146
         $name = "{$name}Service";
147 147
         $name = Str::replaceFirst($this->rootNamespace(), '', $name);
148 148
 
149
-        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
149
+        return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php';
150 150
     }
151 151
 }
Please login to merge, or discard this patch.
src/Console/Commands/MagicRepositoryCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Symfony\Component\Console\Attribute\AsCommand;
8 8
 use Symfony\Component\Console\Input\InputOption;
9 9
 
10
-#[AsCommand(name: 'magic:repository')]
10
+#[AsCommand(name: 'magic:repository') ]
11 11
 class MagicRepositoryCommand extends GeneratorCommand
12 12
 {
13 13
     /**
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $ary = explode("\\", $name);
59
-        $model = $ary[count($ary) - 1];
59
+        $model = $ary[ count($ary) - 1 ];
60 60
         $modelVariable = $this->option('variable');
61 61
         $modelUnderScore = $this->option('underscore');
62 62
         $name = "{$name}Repository";
63 63
 
64 64
         $stub = str_replace(
65
-            ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name)
65
+            [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name)
66 66
         );
67 67
 
68 68
         $stub = str_replace(
69
-            ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub
69
+            [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub
70 70
         );
71 71
 
72 72
         return str_replace(
73
-            ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub
73
+            [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub
74 74
         );
75 75
 
76 76
     }
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     protected function getOptions()
130 130
     {
131 131
         return [
132
-            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists'],
133
-            ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this repository class'],
134
-            ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this repository class'],
132
+            [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the repository already exists' ],
133
+            [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this repository class' ],
134
+            [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this repository class' ],
135 135
         ];
136 136
     }
137 137
 
@@ -146,6 +146,6 @@  discard block
 block discarded – undo
146 146
         $name = "{$name}Repository";
147 147
         $name = Str::replaceFirst($this->rootNamespace(), '', $name);
148 148
 
149
-        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
149
+        return $this->laravel[ 'path' ].'/'.str_replace('\\', '/', $name).'.php';
150 150
     }
151 151
 }
Please login to merge, or discard this patch.
src/Console/Commands/MagicFactoryCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Symfony\Component\Console\Attribute\AsCommand;
8 8
 use Symfony\Component\Console\Input\InputOption;
9 9
 
10
-#[AsCommand(name: 'magic:factory')]
10
+#[AsCommand(name: 'magic:factory') ]
11 11
 class MagicFactoryCommand extends GeneratorCommand
12 12
 {
13 13
     /**
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $ary = explode("\\", $name);
59
-        $model = $ary[count($ary) - 1];
59
+        $model = $ary[ count($ary) - 1 ];
60 60
         $modelVariable = $this->option('variable');
61 61
         $modelUnderScore = $this->option('underscore');
62 62
         $name = "{$name}Factory";
63 63
 
64 64
         $stub = str_replace(
65
-            ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name)
65
+            [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name)
66 66
         );
67 67
 
68 68
         $stub = str_replace(
69
-            ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub
69
+            [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub
70 70
         );
71 71
 
72 72
         return str_replace(
73
-            ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub
73
+            [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub
74 74
         );
75 75
 
76 76
     }
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     protected function getOptions()
130 130
     {
131 131
         return [
132
-            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the factory already exists'],
133
-            ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this factory class'],
134
-            ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this factory class'],
132
+            [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the factory already exists' ],
133
+            [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this factory class' ],
134
+            [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this factory class' ],
135 135
         ];
136 136
     }
137 137
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     protected function getPath($name)
145 145
     {
146 146
         $ary = explode("\\", $name);
147
-        $name = $ary[count($ary) - 1];
147
+        $name = $ary[ count($ary) - 1 ];
148 148
 
149 149
         return base_path("database/factories/{$name}Factory.php");
150 150
     }
Please login to merge, or discard this patch.
src/Console/Commands/MagicTestCommand.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Symfony\Component\Console\Attribute\AsCommand;
8 8
 use Symfony\Component\Console\Input\InputOption;
9 9
 
10
-#[AsCommand(name: 'magic:test')]
10
+#[AsCommand(name: 'magic:test') ]
11 11
 class MagicTestCommand extends GeneratorCommand
12 12
 {
13 13
     /**
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $ary = explode("\\", $name);
59
-        $model = $ary[count($ary) - 1];
59
+        $model = $ary[ count($ary) - 1 ];
60 60
         $modelVariable = $this->option('variable');
61 61
         $modelUnderScore = $this->option('underscore');
62 62
         $name = "{$name}Test";
63 63
 
64 64
         $stub = str_replace(
65
-            ['DummyModel', '{{ model }}'], class_basename($model), parent::buildClass($name)
65
+            [ 'DummyModel', '{{ model }}' ], class_basename($model), parent::buildClass($name)
66 66
         );
67 67
 
68 68
         $stub = str_replace(
69
-            ['DummyModelVariable', '{{ modelVariable }}'], trim($modelVariable, '\\'), $stub
69
+            [ 'DummyModelVariable', '{{ modelVariable }}' ], trim($modelVariable, '\\'), $stub
70 70
         );
71 71
 
72 72
         return str_replace(
73
-            ['DummyModelUnderScore', '{{ modelUnderScore }}'], trim($modelUnderScore, '\\'), $stub
73
+            [ 'DummyModelUnderScore', '{{ modelUnderScore }}' ], trim($modelUnderScore, '\\'), $stub
74 74
         );
75 75
 
76 76
     }
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
     protected function getOptions()
130 130
     {
131 131
         return [
132
-            ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists'],
133
-            ['variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this test class'],
134
-            ['underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this test class'],
132
+            [ 'force', 'f', InputOption::VALUE_NONE, 'Create the class even if the test already exists' ],
133
+            [ 'variable', 'var', InputOption::VALUE_REQUIRED, 'Create a model variable value for this test class' ],
134
+            [ 'underscore', 'u', InputOption::VALUE_REQUIRED, 'Create a model underscore value for this test class' ],
135 135
         ];
136 136
     }
137 137
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     protected function getPath($name)
145 145
     {
146 146
         $ary = explode("\\", $name);
147
-        $name = $ary[count($ary) - 1];
147
+        $name = $ary[ count($ary) - 1 ];
148 148
 
149 149
         return base_path("tests/Feature/{$name}Test.php");
150 150
     }
Please login to merge, or discard this patch.