Completed
Pull Request — master (#6)
by George
05:57 queued 03:58
created
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   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function getMigrationFiles($paths)
89 89
     {
90
-        return Collection::make($paths)->flatMap(function ($path) {
90
+        return Collection::make($paths)->flatMap(function($path) {
91 91
             return $this->files->glob($path.'/*_*.php');
92
-        })->filter()->sortBy(function ($file) {
92
+        })->filter()->sortBy(function($file) {
93 93
             return $this->getMigrationName($file);
94
-        })->values()->keyBy(function ($file) {
94
+        })->values()->keyBy(function($file) {
95 95
             return $this->getMigrationName($file);
96 96
         })->all();
97 97
     }
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
         $this->variables['studlyName'] = Str::studly($this->model->name);
144 144
         $this->variables['studlyNamePlural'] = Str::plural(Str::studly($this->model->name));
145 145
 
146
-        $this->variables['modelVariable'] = "$" . Str::camel($this->model->name);
147
-        $this->variables['modelVariablePlural'] = "$" . Str::plural(Str::camel($this->model->name));
146
+        $this->variables['modelVariable'] = "$".Str::camel($this->model->name);
147
+        $this->variables['modelVariablePlural'] = "$".Str::plural(Str::camel($this->model->name));
148 148
 
149 149
         $this->variables['modelNameLower'] = Str::camel($this->model->name);
150 150
         $this->variables['modelNameLowerPlural'] = Str::plural(Str::camel($this->model->name));
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     public function build($stub)
228 228
     {
229 229
         $path = $this->getStubPath($stub);
230
-        return Vibro::compileFile($path, $this->variables );
230
+        return Vibro::compileFile($path, $this->variables);
231 231
     }
232 232
 
233 233
     public function __call($method, $arguments)
@@ -239,17 +239,17 @@  discard block
 block discarded – undo
239 239
             $fileName = Vibro::compileFileName($config['fileNamePattern'], $this->variables);
240 240
 
241 241
             $path = app_path("$pathPrefix/$fileName");
242
-                if($this->files->exists("$path")) {
242
+                if ($this->files->exists("$path")) {
243 243
                     $this->messages[] = "File '$path' exists and was not overwritten.";
244 244
                     return $this;
245 245
                 }
246 246
 
247
-            if(!$this->files->isDirectory(app_path($pathPrefix))) {
247
+            if (!$this->files->isDirectory(app_path($pathPrefix))) {
248 248
                 $this->files->makeDirectory(app_path("$pathPrefix"));
249 249
             }
250 250
 
251 251
             $content = $this->build($target);
252
-                if($content) {
252
+                if ($content) {
253 253
                     $this->files->put("$path", $content);
254 254
                     $this->created[] = $path;
255 255
                 } else {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     protected function getStub($stub)
264 264
     {
265 265
         $stub = Str::camel($stub);
266
-        if($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) {
266
+        if ($this->files->exists(app_path("Scaffold/stubs/$stub.stub"))) {
267 267
                 return $this->files->get(app_path("Scaffold/stubs/$stub.stub"));
268 268
         } else {
269 269
             return false;
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
     public function addRoutes()
280 280
     {
281
-        foreach(config('scaffold.routes') as $key => $route)
281
+        foreach (config('scaffold.routes') as $key => $route)
282 282
         {
283 283
             $namespace = Str::studly($key);
284 284
             $routeContent = $this->files->get($route['fileName']);
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                 '/([a-zA-Z])(?=[A-Z])/',
287 287
                 '$1-', $this->model->name
288 288
             )));
289
-            if($key = 'web') {
289
+            if ($key = 'web') {
290 290
                 $routeString = "\n\nRoute::resource('$uri', '$namespace\\{$this->model->name}Controller')->only(['index', 'show']);";
291 291
             } else {
292 292
                 $routeString = "\n\nRoute::apiResource('$uri', '$namespace\\{$this->model->name}Controller');";
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@
 block discarded – undo
9 9
 
10 10
 class ServiceProvider extends \Illuminate\Support\ServiceProvider
11 11
 {
12
-    const CONFIG_PATH = __DIR__ . '/../config/scaffold.php';
12
+    const CONFIG_PATH = __DIR__.'/../config/scaffold.php';
13 13
 
14 14
     public function boot()
15 15
     {
16
-        Code::addExtension('stub',  'vibro');
16
+        Code::addExtension('stub', 'vibro');
17 17
         $this->publishes([
18 18
             self::CONFIG_PATH => config_path('scaffold.php'),
19 19
         ], 'config');
Please login to merge, or discard this patch.
src/VibroServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 class VibroServiceProvider extends ViewServiceProvider
17 17
 {
18
-    const CONFIG_PATH = __DIR__ . '/../config/scaffold.php';
18
+    const CONFIG_PATH = __DIR__.'/../config/scaffold.php';
19 19
 
20 20
     public function boot()
21 21
     {
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function register()
28 28
     {
29
-        $this->app->singleton('vibro.compiler', function () {
29
+        $this->app->singleton('vibro.compiler', function() {
30 30
             return new VibroCompiler(
31 31
                 $this->app['files'], $this->app['config']['view.compiled']
32 32
             );
Please login to merge, or discard this patch.
src/VibroCompiler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         extract($args);
67 67
         $parsed = $this->compileString($fileName);
68 68
         ob_start();
69
-        eval( '?>' . $parsed );
69
+        eval('?>'.$parsed);
70 70
         $output = ob_get_contents();
71 71
         ob_end_clean();
72 72
         return $output;
Please login to merge, or discard this patch.
src/Facades/Code.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 namespace Ghaskell\Scaffold\Facades;
10 10
 use Illuminate\Support\Facades\Facade;
11
-class Code extends Facade{
11
+class Code extends Facade {
12 12
     protected static function getFacadeAccessor()
13 13
     {
14 14
         return 'code';
Please login to merge, or discard this patch.
src/Facades/Vibro.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
 namespace Ghaskell\Scaffold\Facades;
10 10
 use Illuminate\Support\Facades\Facade;
11
-class Vibro extends Facade{
11
+class Vibro extends Facade {
12 12
     protected static function getFacadeAccessor()
13 13
     {
14 14
         return 'vibro';
Please login to merge, or discard this patch.
src/CodeServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function registerFactory()
38 38
     {
39
-        $this->app->singleton('code', function ($app) {
39
+        $this->app->singleton('code', function($app) {
40 40
             // Next we need to grab the engine resolver instance that will be used by the
41 41
             // environment. The resolver will be used by an environment to get each of
42 42
             // the various engine implementations such as plain PHP or Blade engine.
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function registerViewFinder()
66 66
     {
67
-        $this->app->bind('code.finder', function ($app) {
67
+        $this->app->bind('code.finder', function($app) {
68 68
             return new FileViewFinder($app['files'], $app['config']['view.paths']);
69 69
         });
70 70
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function registerEngineResolver()
78 78
     {
79
-        $this->app->singleton('view.engine.resolver', function () {
79
+        $this->app->singleton('view.engine.resolver', function() {
80 80
             $resolver = new EngineResolver;
81 81
 
82 82
             // Next, we will register the various view engines with the resolver so that the
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
         // The Compiler engine requires an instance of the CompilerInterface, which in
100 100
         // this case will be the Blade compiler, so we'll first create the compiler
101 101
         // instance to pass into the engine so it can compile the views properly.
102
-        $this->app->singleton('vibro.compiler', function () {
102
+        $this->app->singleton('vibro.compiler', function() {
103 103
             return new VibroCompiler(
104 104
                 $this->app['files'], $this->app['config']['view.compiled']
105 105
             );
106 106
         });
107 107
 
108
-        $resolver->register('vibro', function () {
108
+        $resolver->register('vibro', function() {
109 109
             return new CompilerEngine($this->app['vibro.compiler']);
110 110
         });
111 111
     }
Please login to merge, or discard this patch.