Passed
Push — master ( 284b08...51e9c7 )
by Ilya
05:40 queued 03:13
created
src/Commands/HandlerMakeCommand.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $finalNamespace = $this->getFinalNamespace();
68 68
 
69 69
         $this->getGeneratedClassNames()
70
-            ->each(function (string $className) use ($finalNamespace) {
70
+            ->each(function(string $className) use ($finalNamespace) {
71 71
                 $this->nameInput = $finalNamespace.'\\'.$className;
72 72
                 $this->type = $className.' handler';
73 73
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $defaultNamespace = $this->laravel->getNamespace().'Http\\Handlers';
88 88
 
89
-        if (! is_null($namespaceOption = $this->getValidatedAndNormalizedNamespaceOption())) {
89
+        if (!is_null($namespaceOption = $this->getValidatedAndNormalizedNamespaceOption())) {
90 90
             if (starts_with($namespaceOption, '\\')) {
91 91
                 return $namespaceOption;
92 92
             }
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
     {
107 107
         $namespace = (string) $this->option('namespace');
108 108
 
109
-        if (! $namespace) {
109
+        if (!$namespace) {
110 110
             return null;
111 111
         }
112 112
 
113 113
         $namespaceWithNormalizedSlashes = preg_replace('/[\/\\\]+/', '\\', $namespace);
114 114
 
115
-        if (! preg_match('/^(\\\|(\\\?\w+)+)$/', $namespaceWithNormalizedSlashes)) {
115
+        if (!preg_match('/^(\\\|(\\\?\w+)+)$/', $namespaceWithNormalizedSlashes)) {
116 116
             $this->error('['.$namespace.'] is not a valid namespace.');
117 117
             exit;
118 118
         }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         if ($this->actions->isEmpty()) {
140 140
             return collect([$name]);
141 141
         } else {
142
-            return $this->actions->map(function (string $action) use ($name) {
142
+            return $this->actions->map(function(string $action) use ($name) {
143 143
                 return studly_case($action).$name;
144 144
             });
145 145
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     protected function getValidatedNameArgument(): string
154 154
     {
155 155
         $name = (string) $this->argument('name');
156
-        if (! preg_match('/^\w+$/', $name)) {
156
+        if (!preg_match('/^\w+$/', $name)) {
157 157
             $this->error('Name can\'t contain any non-word characters.');
158 158
             exit;
159 159
         }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         if ($this->option('resource')) {
172 172
             collect(['index', 'show', 'create', 'store', 'edit', 'update', 'destroy'])
173
-                ->each(function (string $resourceAction) {
173
+                ->each(function(string $resourceAction) {
174 174
                     $this->addActionIfNotExists($resourceAction);
175 175
                 });
176 176
         }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     {
188 188
         if ($actions = (string) $this->option('actions')) {
189 189
             collect(explode(',', $actions))
190
-                ->each(function (string $action) {
190
+                ->each(function(string $action) {
191 191
                     $this->addActionIfNotExists(
192 192
                         $this->getValidatedAndNormalizedActionName($action)
193 193
                     );
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     {
207 207
         if ($except = (string) $this->option('except')) {
208 208
             collect(explode(',', $except))
209
-                ->each(function (string $action) {
209
+                ->each(function(string $action) {
210 210
                     $this->deleteActionIfExists(
211 211
                         $this->getValidatedAndNormalizedActionName($action)
212 212
                     );
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     {
226 226
         if ($this->option('api')) {
227 227
             collect(['edit', 'create'])
228
-                ->each(function (string $action) {
228
+                ->each(function(string $action) {
229 229
                     $this->deleteActionIfExists($action);
230 230
                 });
231 231
         }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function addActionIfNotExists(string $action): void
243 243
     {
244
-        if (! $this->actions->contains($action)) {
244
+        if (!$this->actions->contains($action)) {
245 245
             $this->actions->push($action);
246 246
         }
247 247
     }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function deleteActionIfExists(string $action): void
255 255
     {
256
-        $this->actions = $this->actions->reject(function (string $existingAction) use ($action, &$exists) {
256
+        $this->actions = $this->actions->reject(function(string $existingAction) use ($action, &$exists) {
257 257
             return $existingAction === $action;
258 258
         });
259 259
     }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
      */
267 267
     protected function getValidatedAndNormalizedActionName(string $action): string
268 268
     {
269
-        if (! preg_match('/^\w+$/', $action)) {
269
+        if (!preg_match('/^\w+$/', $action)) {
270 270
             $this->error('['.$action.'] is not a valid action name.');
271 271
             exit;
272 272
         }
Please login to merge, or discard this patch.