Passed
Branch develop (e85239)
by Ilya
06:00 queued 03:25
created
src/Commands/HandlerMakeCommand.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
             $finalNamespace = $this->getFinalNamespace();
70 70
 
71 71
             foreach ($classNames as $className) {
72
-                $this->nameInput = $finalNamespace . '\\' . $className;
73
-                $this->type = $className . ' handler';
72
+                $this->nameInput = $finalNamespace.'\\'.$className;
73
+                $this->type = $className.' handler';
74 74
 
75 75
                 parent::handle();
76 76
             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $defaultNamespace = $this->laravel->getNamespace().'Http\\Handlers';
95 95
 
96
-        if (! is_null($namespaceOption = $this->getValidatedAndNormalizedNamespaceOption())) {
96
+        if (!is_null($namespaceOption = $this->getValidatedAndNormalizedNamespaceOption())) {
97 97
             if (starts_with($namespaceOption, '\\')) {
98 98
                 return $namespaceOption;
99 99
             }
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $namespace = (string) $this->option('namespace');
116 116
 
117
-        if (! $namespace) {
117
+        if (!$namespace) {
118 118
             return null;
119 119
         }
120 120
 
121 121
         $namespaceWithNormalizedSlashes = preg_replace('/[\/\\\]+/', '\\', $namespace);
122 122
 
123
-        if (! preg_match('/^(\\\|(\\\?\w+)+)$/', $namespaceWithNormalizedSlashes)) {
123
+        if (!preg_match('/^(\\\|(\\\?\w+)+)$/', $namespaceWithNormalizedSlashes)) {
124 124
             throw new CommandException('['.$namespace.'] is not a valid namespace.');
125 125
         }
126 126
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         if ($bag->isEmpty()) {
142 142
             return [$name];
143 143
         } else {
144
-            return array_map(function (string $action) use ($name) {
144
+            return array_map(function(string $action) use ($name) {
145 145
                 return studly_case($action).$name;
146 146
             }, $bag->get());
147 147
         }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     protected function getValidatedNameArgument(): string
157 157
     {
158 158
         $name = (string) $this->argument('name');
159
-        if (! preg_match('/^\w+$/', $name)) {
159
+        if (!preg_match('/^\w+$/', $name)) {
160 160
             throw new CommandException('Name can\'t contain any non-word characters.');
161 161
         }
162 162
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             return $base;
279 279
         }
280 280
 
281
-        throw new CommandException('The [' . $base . '] class specified as the base handler doesn\'t exist.');
281
+        throw new CommandException('The ['.$base.'] class specified as the base handler doesn\'t exist.');
282 282
     }
283 283
 
284 284
     /**
Please login to merge, or discard this patch.
tests/HandlerMakeCommandTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
         $this->assertDirectoryNotExists($this->app->path('Handlers'));
46 46
 
47
-        $this->assertEquals(Artisan::output(), 'Name can\'t contain any non-word characters.' . PHP_EOL);
47
+        $this->assertEquals(Artisan::output(), 'Name can\'t contain any non-word characters.'.PHP_EOL);
48 48
     }
49 49
 
50 50
     public function test_create_existent_handler_without_force_option()
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $this->assertEquals($initialHandlerContent, file_get_contents($filePath));
64 64
 
65
-        $this->assertEquals(Artisan::output(), 'ShowProfile handler already exists!' . PHP_EOL);
65
+        $this->assertEquals(Artisan::output(), 'ShowProfile handler already exists!'.PHP_EOL);
66 66
     }
67 67
 
68 68
     public function test_create_existent_handler_with_force_option()
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         $this->assertDirectoryNotExists($this->app->path('Handlers'));
118 118
 
119
-        $this->assertEquals(Artisan::output(), '[InvalidNamespace%] is not a valid namespace.' . PHP_EOL);
119
+        $this->assertEquals(Artisan::output(), '[InvalidNamespace%] is not a valid namespace.'.PHP_EOL);
120 120
     }
121 121
 
122 122
     public function test_resource_option()
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
         $this->assertDirectoryNotExists($this->app->path('Handlers'));
188 188
 
189
-        $this->assertEquals(Artisan::output(), '[destroy%] is not a valid action name.' . PHP_EOL);
189
+        $this->assertEquals(Artisan::output(), '[destroy%] is not a valid action name.'.PHP_EOL);
190 190
     }
191 191
 
192 192
     public function test_except_option()
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
         $this->assertDirectoryNotExists($this->app->path('Handlers'));
223 223
 
224
-        $this->assertEquals(Artisan::output(), '[destroy%] is not a valid action name.' . PHP_EOL);
224
+        $this->assertEquals(Artisan::output(), '[destroy%] is not a valid action name.'.PHP_EOL);
225 225
     }
226 226
 
227 227
     public function test_proper_file_content_generation()
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             'name' => 'ShowProfile',
263 263
         ]);
264 264
 
265
-        $this->assertEquals(Artisan::output(), 'The [Foo\\Bar\\Invalid\\ClassName] class specified as the base handler doesn\'t exist.' . PHP_EOL);
265
+        $this->assertEquals(Artisan::output(), 'The [Foo\\Bar\\Invalid\\ClassName] class specified as the base handler doesn\'t exist.'.PHP_EOL);
266 266
     }
267 267
 
268 268
     /**
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
      */
275 275
     protected function getHandlerFileNamesByNameAndActions(string $name, array $actions): array
276 276
     {
277
-        return array_map(function (string $action) use ($name) {
277
+        return array_map(function(string $action) use ($name) {
278 278
             return studly_case($action).studly_case($name).'.php';
279 279
         }, $actions);
280 280
     }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      */
288 288
     protected function getFileNamesByPath(string $path): array
289 289
     {
290
-        return array_map(function (SplFileInfo $file) {
290
+        return array_map(function(SplFileInfo $file) {
291 291
             return $file->getFilename();
292 292
         }, $this->files->files($path));
293 293
     }
Please login to merge, or discard this patch.