Passed
Push — main ( 567788...d34df7 )
by ikechukwu
02:55
created
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.