@@ -72,10 +72,10 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -87,11 +87,11 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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');"; |
@@ -9,11 +9,11 @@ |
||
| 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'); |
@@ -15,7 +15,7 @@ discard block |
||
| 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 |
||
| 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 | ); |
@@ -66,7 +66,7 @@ |
||
| 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; |
@@ -8,7 +8,7 @@ |
||
| 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'; |
@@ -8,7 +8,7 @@ |
||
| 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'; |
@@ -36,7 +36,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |