Completed
Pull Request — master (#4)
by George
02:32
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   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
                 ->buildApiController()
73 73
                 ->buildWebController()
74 74
                 ->addRoutes();
75
-            foreach($scaffold->created as $created) {
75
+            foreach ($scaffold->created as $created) {
76 76
                 $this->info("File '$created' generated.");
77 77
             }
78
-            foreach($scaffold->messages as $message) {
78
+            foreach ($scaffold->messages as $message) {
79 79
                 $this->comment($message);
80 80
             }
81 81
             $this->line("------------------------------------------------------------------------------------------------------------------");
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
         $files = $finder->files()
90 90
             ->name('*table.php')
91 91
             ->notName('2014*')
92
-            ->in(database_path() . '/migrations');
92
+            ->in(database_path().'/migrations');
93 93
 
94 94
         foreach ($files as $file) {
95
-            $this->migrations[] = $file->getRealPath() ;
95
+            $this->migrations[] = $file->getRealPath();
96 96
         }
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
src/Scaffold.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         $this->template = new \Mustache_Engine([
36 36
             'delimiters' => '<% %>',
37
-            'escape' => function ($value) {
37
+            'escape' => function($value) {
38 38
                 return $value; //no escaping.
39 39
             }
40 40
         ]);
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function getMigrationFiles($paths)
94 94
     {
95
-        return Collection::make($paths)->flatMap(function ($path) {
95
+        return Collection::make($paths)->flatMap(function($path) {
96 96
             return $this->files->glob($path.'/*_*.php');
97
-        })->filter()->sortBy(function ($file) {
97
+        })->filter()->sortBy(function($file) {
98 98
             return $this->getMigrationName($file);
99
-        })->values()->keyBy(function ($file) {
99
+        })->values()->keyBy(function($file) {
100 100
             return $this->getMigrationName($file);
101 101
         })->all();
102 102
     }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
         $this->variables['studlyName'] = Str::studly($this->model->name);
149 149
 
150
-        $this->variables['modelVariable'] = "$" . Str::camel($this->model->name);
150
+        $this->variables['modelVariable'] = "$".Str::camel($this->model->name);
151 151
 
152 152
         $this->variables['modelNameLower'] = Str::camel($this->model->name);
153 153
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     public function build($stub)
230 230
     {
231 231
         $stub = $this->getStub($stub);
232
-        if(!empty($stub)) {
232
+        if (!empty($stub)) {
233 233
             return $this->template
234 234
                 ->render(
235 235
                     $stub,
@@ -249,18 +249,18 @@  discard block
 block discarded – undo
249 249
             $pathPrefix = $config['path'];
250 250
             $fileName = $this->template->render($config['fileNamePattern'], $this->variables);
251 251
             $path = app_path("$pathPrefix/$fileName");
252
-                if($this->files->exists("$path")) {
252
+                if ($this->files->exists("$path")) {
253 253
                     $this->messages[] = "File '$path' exists and was not overwritten.";
254 254
                     return $this;
255 255
                 }
256 256
 
257 257
 //            $this->files->makeDirectory(app_path("$pathPrefix"), 0755, false, true);
258
-            if(!$this->files->isDirectory(app_path($pathPrefix))) {
258
+            if (!$this->files->isDirectory(app_path($pathPrefix))) {
259 259
                 $this->files->makeDirectory(app_path("$pathPrefix"));
260 260
             }
261 261
 
262 262
             $content = $this->build($target);
263
-                if($content) {
263
+                if ($content) {
264 264
                     $this->files->put("$path", $content);
265 265
                     $this->created[] = $path;
266 266
                 } else {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
     protected function getStub($stub)
275 275
     {
276 276
         $stub = Str::camel($stub);
277
-        if($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) {
277
+        if ($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) {
278 278
                 return $this->files->get(app_path("Scaffold/stubs/$stub.stub"));
279 279
         } else {
280 280
             return false;
Please login to merge, or discard this patch.