@@ -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 | ); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function registerFactory() |
43 | 43 | { |
44 | - $this->app->singleton('view', function ($app) { |
|
44 | + $this->app->singleton('view', function($app) { |
|
45 | 45 | // Next we need to grab the engine resolver instance that will be used by the |
46 | 46 | // environment. The resolver will be used by an environment to get each of |
47 | 47 | // the various engine implementations such as plain PHP or Blade engine. |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function registerViewFinder() |
84 | 84 | { |
85 | - $this->app->bind('view.finder', function ($app) { |
|
85 | + $this->app->bind('view.finder', function($app) { |
|
86 | 86 | return new FileViewFinder($app['files'], $app['config']['view.paths']); |
87 | 87 | }); |
88 | 88 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function registerEngineResolver() |
96 | 96 | { |
97 | - $this->app->singleton('view.engine.resolver', function () { |
|
97 | + $this->app->singleton('view.engine.resolver', function() { |
|
98 | 98 | $resolver = new EngineResolver; |
99 | 99 | |
100 | 100 | // Next, we will register the various view engines with the resolver so that the |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function registerFileEngine($resolver) |
118 | 118 | { |
119 | - $resolver->register('file', function () { |
|
119 | + $resolver->register('file', function() { |
|
120 | 120 | return new FileEngine; |
121 | 121 | }); |
122 | 122 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function registerPhpEngine($resolver) |
131 | 131 | { |
132 | - $resolver->register('php', function () { |
|
132 | + $resolver->register('php', function() { |
|
133 | 133 | return new PhpEngine; |
134 | 134 | }); |
135 | 135 | } |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | // The Compiler engine requires an instance of the CompilerInterface, which in |
146 | 146 | // this case will be the Blade compiler, so we'll first create the compiler |
147 | 147 | // instance to pass into the engine so it can compile the views properly. |
148 | - $this->app->singleton('blade.compiler', function () { |
|
148 | + $this->app->singleton('blade.compiler', function() { |
|
149 | 149 | return new VibroCompiler( |
150 | 150 | $this->app['files'], $this->app['config']['view.compiled'] |
151 | 151 | ); |
152 | 152 | }); |
153 | 153 | |
154 | - $resolver->register('blade', function () { |
|
154 | + $resolver->register('blade', function() { |
|
155 | 155 | return new CompilerEngine($this->app['blade.compiler']); |
156 | 156 | }); |
157 | 157 | } |
@@ -167,13 +167,13 @@ discard block |
||
167 | 167 | // The Compiler engine requires an instance of the CompilerInterface, which in |
168 | 168 | // this case will be the Blade compiler, so we'll first create the compiler |
169 | 169 | // instance to pass into the engine so it can compile the views properly. |
170 | - $this->app->singleton('vibro.compiler', function () { |
|
170 | + $this->app->singleton('vibro.compiler', function() { |
|
171 | 171 | return new VibroCompiler( |
172 | 172 | $this->app['files'], $this->app['config']['view.compiled'] |
173 | 173 | ); |
174 | 174 | }); |
175 | 175 | |
176 | - $resolver->register('vibro', function () { |
|
176 | + $resolver->register('vibro', function() { |
|
177 | 177 | return new CompilerEngine($this->app['vibro.compiler']); |
178 | 178 | }); |
179 | 179 | } |
@@ -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'; |