Passed
Push — master ( cb0d94...162b2f )
by George
02:34
created
src/ServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class ServiceProvider extends \Illuminate\Support\ServiceProvider
8 8
 {
9
-    const CONFIG_PATH = __DIR__ . '/../config/scaffold.php';
9
+    const CONFIG_PATH = __DIR__.'/../config/scaffold.php';
10 10
 
11 11
     public function boot()
12 12
     {
Please login to merge, or discard this patch.
src/Console/Commands/ScaffoldGenerate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 ->buildRequest()
70 70
                 ->buildApiController()
71 71
                 ->addRoutes();
72
-            foreach($scaffold->messages as $message) {
72
+            foreach ($scaffold->messages as $message) {
73 73
                 $this->line($message);
74 74
             }
75 75
         }
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
         $files = $finder->files()
83 83
             ->name('*table.php')
84 84
             ->notName('2014*')
85
-            ->in(database_path() . '/migrations');
85
+            ->in(database_path().'/migrations');
86 86
 
87 87
         foreach ($files as $file) {
88
-            $this->migrations[] = $file->getRealPath() ;
88
+            $this->migrations[] = $file->getRealPath();
89 89
         }
90 90
     }
91 91
 }
Please login to merge, or discard this patch.
src/Scaffold.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
         $this->template = new \Mustache_Engine([
35 35
             'delimiters' => '<% %>',
36
-            'escape' => function ($value) {
36
+            'escape' => function($value) {
37 37
                 return $value; //no escaping.
38 38
             }
39 39
         ]);
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function getMigrationFiles($paths)
93 93
     {
94
-        return Collection::make($paths)->flatMap(function ($path) {
94
+        return Collection::make($paths)->flatMap(function($path) {
95 95
             return $this->files->glob($path.'/*_*.php');
96
-        })->filter()->sortBy(function ($file) {
96
+        })->filter()->sortBy(function($file) {
97 97
             return $this->getMigrationName($file);
98
-        })->values()->keyBy(function ($file) {
98
+        })->values()->keyBy(function($file) {
99 99
             return $this->getMigrationName($file);
100 100
         })->all();
101 101
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     {
145 145
         $this->variables['modelName'] = $this->model->name;
146 146
 
147
-        $this->variables['modelVariable'] = "$" . Str::camel($this->model->name);
147
+        $this->variables['modelVariable'] = "$".Str::camel($this->model->name);
148 148
 
149 149
 
150 150
         if ($this->rules) {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     public function build($stub)
225 225
     {
226 226
         $stub = $this->getStub($stub);
227
-        if(!empty($stub)) {
227
+        if (!empty($stub)) {
228 228
             return $this->template
229 229
                 ->render(
230 230
                     $stub,
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
         if (starts_with($method, 'build')) {
242 242
             if (str_contains($method, "Model")) {
243 243
                 $path = app_path($this->model->name);
244
-                if($this->files->exists("$path.php")) {
244
+                if ($this->files->exists("$path.php")) {
245 245
                     $this->messages[] = "File {$this->model->name}.php already exists.";
246 246
                     return $this;
247 247
                 }
248 248
             } elseif (str_contains($method, "ApiController")) {
249 249
                 $path = app_path("Http/Controllers/Api/".$this->model->name."Controller");
250
-                if($this->files->exists("$path.php")) {
250
+                if ($this->files->exists("$path.php")) {
251 251
                     $this->messages[] = "File {$this->model->name}Controller.php already exists.";
252 252
                     return $this;
253 253
                 }
@@ -255,25 +255,25 @@  discard block
 block discarded – undo
255 255
                 $this->files->makeDirectory(app_path("Http/Controllers/Web"), 0755, false, true);
256 256
             } elseif (str_contains($method, "Request")) {
257 257
                 $path = app_path("Http/Requests/".$this->model->name."Request");
258
-                if($this->files->exists("$path.php")) {
258
+                if ($this->files->exists("$path.php")) {
259 259
                     $this->messages[] = "File {$this->model->name}Request.php already exists.";
260 260
                     return $this;
261 261
                 }
262 262
             } else {
263 263
                 $path = app_path();
264
-                if($this->files->exists("$path.php")) {
264
+                if ($this->files->exists("$path.php")) {
265 265
                     $this->messages[] = "File {$this->model->name}.php already exists.";
266 266
                     return $this;
267 267
                 }
268 268
             }
269 269
 
270
-            if($this->files->exists("$path.php")) {
270
+            if ($this->files->exists("$path.php")) {
271 271
                 $this->messages[] = "File {$this->model->name}Controller already exists.";
272 272
                 return $this;
273 273
             }
274 274
             $target = substr($method, 5);
275 275
             $content = $this->build($target);
276
-            if($content) {
276
+            if ($content) {
277 277
                 $this->files->put("$path.php", $content);
278 278
             } else {
279 279
                 $this->messages[] = "File stub $target not found.";
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 
286 286
     protected function getStub($stub)
287 287
     {
288
-        if($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) {
288
+        if ($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) {
289 289
                 return $this->files->get(app_path("Scaffold/stubs/$stub.stub"));
290 290
         } else {
291 291
             return false;
Please login to merge, or discard this patch.