@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | public function show($id) |
46 | - { |
|
47 | - return 'Not implemented'; |
|
48 | - } |
|
46 | + { |
|
47 | + return 'Not implemented'; |
|
48 | + } |
|
49 | 49 | |
50 | 50 | public function edit($id) |
51 | - { |
|
52 | - $model = {{class_name}}::find($id); |
|
51 | + { |
|
52 | + $model = {{class_name}}::find($id); |
|
53 | 53 | |
54 | 54 | return view('{{class_name_lw}}.edit')->with('model', $model); |
55 | - } |
|
55 | + } |
|
56 | 56 | |
57 | 57 | public function update($id, Request $request) |
58 | - { |
|
58 | + { |
|
59 | 59 | $this->validate($request, [ |
60 | 60 | |
61 | 61 | {{validations}} |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | |
64 | 64 | {{class_name}}::find($id)->fill($request->all())->save(); |
65 | 65 | |
66 | - return response()->json(['message' => 'ok']); |
|
67 | - } |
|
66 | + return response()->json(['message' => 'ok']); |
|
67 | + } |
|
68 | 68 | |
69 | 69 | public function destroy($id) |
70 | - { |
|
70 | + { |
|
71 | 71 | {{class_name}}::destroy($id); |
72 | 72 | |
73 | - return response()->json(['message' => 'ok']); |
|
74 | - } |
|
73 | + return response()->json(['message' => 'ok']); |
|
74 | + } |
|
75 | 75 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function get{{class_name}}s() |
18 | 18 | { |
19 | 19 | return Datatables::of({{class_name}}::select('*')) |
20 | - ->addColumn('action', function ($model) { |
|
20 | + ->addColumn('action', function($model) { |
|
21 | 21 | return ' |
22 | 22 | <a href="/{{route_prefix}}/{{class_name_lw}}/'.$model->{{primaryKey}}.'/edit"><i class="material-icons">create</i></a> |
23 | 23 | <a href="#" onclick="deleteModel(\''.$model->{{primaryKey}}.'\')"><i class="material-icons">delete</i></a>'; |
@@ -3,14 +3,14 @@ |
||
3 | 3 | use Illuminate\Database\Schema\Blueprint; |
4 | 4 | use Illuminate\Database\Migrations\Migration; |
5 | 5 | |
6 | -class Create{{class_name}}sTable extends Migration |
|
6 | +class Create {{class_name}}sTable extends Migration |
|
7 | 7 | { |
8 | 8 | /** |
9 | 9 | * Run the migrations. |
10 | 10 | */ |
11 | 11 | public function up() |
12 | 12 | { |
13 | - Schema::create('{{table_name}}s', function (Blueprint $table) { |
|
13 | + Schema::create('{{table_name}}s', function(Blueprint $table) { |
|
14 | 14 | |
15 | 15 | {{fields}} |
16 | 16 | }); |
@@ -10,68 +10,68 @@ |
||
10 | 10 | |
11 | 11 | class ScaffolderServiceProvider extends ServiceProvider |
12 | 12 | { |
13 | - /** |
|
14 | - * Bootstrap the application services. |
|
15 | - */ |
|
16 | - public function boot() |
|
17 | - { |
|
18 | - // Scaffolder config |
|
19 | - $this->publishes([ |
|
20 | - __DIR__ . '/../../config/' => base_path('scaffolder-config/') |
|
21 | - ], 'config'); |
|
13 | + /** |
|
14 | + * Bootstrap the application services. |
|
15 | + */ |
|
16 | + public function boot() |
|
17 | + { |
|
18 | + // Scaffolder config |
|
19 | + $this->publishes([ |
|
20 | + __DIR__ . '/../../config/' => base_path('scaffolder-config/') |
|
21 | + ], 'config'); |
|
22 | 22 | |
23 | - // Generator views |
|
24 | - //$this->loadViewsFrom(__DIR__ . '/../../views', 'scaffolder'); |
|
23 | + // Generator views |
|
24 | + //$this->loadViewsFrom(__DIR__ . '/../../views', 'scaffolder'); |
|
25 | 25 | |
26 | - // Generator routes |
|
27 | - if (!$this->app->routesAreCached()) |
|
28 | - { |
|
29 | - require __DIR__ . '/../../routes/generator.php'; |
|
30 | - } |
|
31 | - } |
|
26 | + // Generator routes |
|
27 | + if (!$this->app->routesAreCached()) |
|
28 | + { |
|
29 | + require __DIR__ . '/../../routes/generator.php'; |
|
30 | + } |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * Register the service provider. |
|
35 | - * |
|
36 | - * @return void |
|
37 | - */ |
|
38 | - public function register() |
|
39 | - { |
|
40 | - $this->app->singleton('scaffolder.command.generate', function ($app) |
|
41 | - { |
|
42 | - return new GeneratorCommand(); |
|
43 | - }); |
|
33 | + /** |
|
34 | + * Register the service provider. |
|
35 | + * |
|
36 | + * @return void |
|
37 | + */ |
|
38 | + public function register() |
|
39 | + { |
|
40 | + $this->app->singleton('scaffolder.command.generate', function ($app) |
|
41 | + { |
|
42 | + return new GeneratorCommand(); |
|
43 | + }); |
|
44 | 44 | |
45 | - $this->app->singleton('scaffolder.command.cache.clear', function () |
|
46 | - { |
|
47 | - return new ClearCacheCommand(); |
|
48 | - }); |
|
45 | + $this->app->singleton('scaffolder.command.cache.clear', function () |
|
46 | + { |
|
47 | + return new ClearCacheCommand(); |
|
48 | + }); |
|
49 | 49 | |
50 | - $this->app->singleton('scaffolder.command.build', function () |
|
51 | - { |
|
52 | - return new BuildCommand(); |
|
53 | - }); |
|
50 | + $this->app->singleton('scaffolder.command.build', function () |
|
51 | + { |
|
52 | + return new BuildCommand(); |
|
53 | + }); |
|
54 | 54 | |
55 | - $this->app->singleton('scaffolder.command.serve', function () |
|
56 | - { |
|
57 | - return new ServeCommand(); |
|
58 | - }); |
|
55 | + $this->app->singleton('scaffolder.command.serve', function () |
|
56 | + { |
|
57 | + return new ServeCommand(); |
|
58 | + }); |
|
59 | 59 | |
60 | - $this->commands([ |
|
61 | - 'scaffolder.command.generate', |
|
62 | - 'scaffolder.command.cache.clear', |
|
63 | - 'scaffolder.command.build', |
|
64 | - 'scaffolder.command.serve' |
|
65 | - ]); |
|
66 | - } |
|
60 | + $this->commands([ |
|
61 | + 'scaffolder.command.generate', |
|
62 | + 'scaffolder.command.cache.clear', |
|
63 | + 'scaffolder.command.build', |
|
64 | + 'scaffolder.command.serve' |
|
65 | + ]); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Get the services provided by the provider. |
|
70 | - * |
|
71 | - * @return array |
|
72 | - */ |
|
73 | - public function provides() |
|
74 | - { |
|
75 | - return ['scaffolder.command.generate', 'scaffolder.command.cache.clear', 'scaffolder.command.serve', 'scaffolder.command.build']; |
|
76 | - } |
|
68 | + /** |
|
69 | + * Get the services provided by the provider. |
|
70 | + * |
|
71 | + * @return array |
|
72 | + */ |
|
73 | + public function provides() |
|
74 | + { |
|
75 | + return ['scaffolder.command.generate', 'scaffolder.command.cache.clear', 'scaffolder.command.serve', 'scaffolder.command.build']; |
|
76 | + } |
|
77 | 77 | } |
78 | 78 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | // Scaffolder config |
19 | 19 | $this->publishes([ |
20 | - __DIR__ . '/../../config/' => base_path('scaffolder-config/') |
|
20 | + __DIR__.'/../../config/' => base_path('scaffolder-config/') |
|
21 | 21 | ], 'config'); |
22 | 22 | |
23 | 23 | // Generator views |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // Generator routes |
27 | 27 | if (!$this->app->routesAreCached()) |
28 | 28 | { |
29 | - require __DIR__ . '/../../routes/generator.php'; |
|
29 | + require __DIR__.'/../../routes/generator.php'; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
@@ -37,22 +37,22 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function register() |
39 | 39 | { |
40 | - $this->app->singleton('scaffolder.command.generate', function ($app) |
|
40 | + $this->app->singleton('scaffolder.command.generate', function($app) |
|
41 | 41 | { |
42 | 42 | return new GeneratorCommand(); |
43 | 43 | }); |
44 | 44 | |
45 | - $this->app->singleton('scaffolder.command.cache.clear', function () |
|
45 | + $this->app->singleton('scaffolder.command.cache.clear', function() |
|
46 | 46 | { |
47 | 47 | return new ClearCacheCommand(); |
48 | 48 | }); |
49 | 49 | |
50 | - $this->app->singleton('scaffolder.command.build', function () |
|
50 | + $this->app->singleton('scaffolder.command.build', function() |
|
51 | 51 | { |
52 | 52 | return new BuildCommand(); |
53 | 53 | }); |
54 | 54 | |
55 | - $this->app->singleton('scaffolder.command.serve', function () |
|
55 | + $this->app->singleton('scaffolder.command.serve', function() |
|
56 | 56 | { |
57 | 57 | return new ServeCommand(); |
58 | 58 | }); |
@@ -6,13 +6,13 @@ |
||
6 | 6 | |
7 | 7 | class Directory |
8 | 8 | { |
9 | - public static function createIfNotExists($path, $mode = 0755, $recursive = false, $force = false) |
|
10 | - { |
|
11 | - if (!File::isDirectory($path)) |
|
12 | - { |
|
13 | - File::makeDirectory($path, $mode, $recursive , $force ); |
|
14 | - } |
|
15 | - } |
|
9 | + public static function createIfNotExists($path, $mode = 0755, $recursive = false, $force = false) |
|
10 | + { |
|
11 | + if (!File::isDirectory($path)) |
|
12 | + { |
|
13 | + File::makeDirectory($path, $mode, $recursive , $force ); |
|
14 | + } |
|
15 | + } |
|
16 | 16 | |
17 | 17 | |
18 | 18 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | if (!File::isDirectory($path)) |
12 | 12 | { |
13 | - File::makeDirectory($path, $mode, $recursive , $force ); |
|
13 | + File::makeDirectory($path, $mode, $recursive, $force); |
|
14 | 14 | } |
15 | 15 | } |
16 | 16 |
@@ -7,104 +7,104 @@ |
||
7 | 7 | |
8 | 8 | class Validator |
9 | 9 | { |
10 | - /** |
|
11 | - * Parse a string based rule. |
|
12 | - * |
|
13 | - * @param string $rules |
|
14 | - * @return array |
|
15 | - */ |
|
16 | - public static function parseStringRule($rules) |
|
17 | - { |
|
18 | - $parameters = []; |
|
19 | - |
|
20 | - // The format for specifying validation rules and parameters follows an |
|
21 | - // easy {rule}:{parameters} formatting convention. For instance the |
|
22 | - // rule "Max:3" states that the value may only be three letters. |
|
23 | - if (strpos($rules, ':') !== false) { |
|
24 | - list($rules, $parameter) = explode(':', $rules, 2); |
|
25 | - |
|
26 | - $parameters = self::parseParameters($rules, $parameter); |
|
27 | - } |
|
28 | - |
|
29 | - return [(trim($rules)), $parameters]; |
|
30 | - } |
|
31 | - |
|
32 | - /** |
|
33 | - * Parse a parameter list. |
|
34 | - * |
|
35 | - * @param string $rule |
|
36 | - * @param string $parameter |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - public static function parseParameters($rule, $parameter) |
|
40 | - { |
|
41 | - if (strtolower($rule) == 'regex') { |
|
42 | - return [$parameter]; |
|
43 | - } |
|
44 | - |
|
45 | - return str_getcsv($parameter); |
|
46 | - } |
|
47 | - |
|
48 | - /** |
|
49 | - * Explode the rules into an array of rules. |
|
50 | - * |
|
51 | - * @param string $rules |
|
52 | - * @return array |
|
53 | - */ |
|
54 | - public static function explodeRule($rule) |
|
55 | - { |
|
56 | - return explode('|', $rule); |
|
57 | - } |
|
58 | - |
|
59 | - /** |
|
60 | - * Convert laravel validations to theme validation angular js. |
|
61 | - * |
|
62 | - * @param string $validations |
|
63 | - * @return array |
|
64 | - */ |
|
65 | - public static function convertValidations($validations, $blnSearch = false){ |
|
66 | - $validationsConverted = []; |
|
67 | - foreach (self::explodeRule($validations) as $validation) { |
|
68 | - $validation = self::parseStringRule($validation); |
|
69 | - |
|
70 | - if(isset($validation[0])){ |
|
71 | - |
|
72 | - $rule = $validation[0]; |
|
73 | - $values = $validation[1]; |
|
74 | - |
|
75 | - switch ($rule) { |
|
76 | - case 'required': |
|
77 | - if($blnSearch) { |
|
78 | - $attribute = null ; |
|
79 | - $attributeValue = null ; |
|
80 | - } |
|
81 | - else { |
|
82 | - $attribute = "required" ; |
|
83 | - $attributeValue = null ; |
|
84 | - } |
|
10 | + /** |
|
11 | + * Parse a string based rule. |
|
12 | + * |
|
13 | + * @param string $rules |
|
14 | + * @return array |
|
15 | + */ |
|
16 | + public static function parseStringRule($rules) |
|
17 | + { |
|
18 | + $parameters = []; |
|
19 | + |
|
20 | + // The format for specifying validation rules and parameters follows an |
|
21 | + // easy {rule}:{parameters} formatting convention. For instance the |
|
22 | + // rule "Max:3" states that the value may only be three letters. |
|
23 | + if (strpos($rules, ':') !== false) { |
|
24 | + list($rules, $parameter) = explode(':', $rules, 2); |
|
25 | + |
|
26 | + $parameters = self::parseParameters($rules, $parameter); |
|
27 | + } |
|
28 | + |
|
29 | + return [(trim($rules)), $parameters]; |
|
30 | + } |
|
31 | + |
|
32 | + /** |
|
33 | + * Parse a parameter list. |
|
34 | + * |
|
35 | + * @param string $rule |
|
36 | + * @param string $parameter |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + public static function parseParameters($rule, $parameter) |
|
40 | + { |
|
41 | + if (strtolower($rule) == 'regex') { |
|
42 | + return [$parameter]; |
|
43 | + } |
|
44 | + |
|
45 | + return str_getcsv($parameter); |
|
46 | + } |
|
47 | + |
|
48 | + /** |
|
49 | + * Explode the rules into an array of rules. |
|
50 | + * |
|
51 | + * @param string $rules |
|
52 | + * @return array |
|
53 | + */ |
|
54 | + public static function explodeRule($rule) |
|
55 | + { |
|
56 | + return explode('|', $rule); |
|
57 | + } |
|
58 | + |
|
59 | + /** |
|
60 | + * Convert laravel validations to theme validation angular js. |
|
61 | + * |
|
62 | + * @param string $validations |
|
63 | + * @return array |
|
64 | + */ |
|
65 | + public static function convertValidations($validations, $blnSearch = false){ |
|
66 | + $validationsConverted = []; |
|
67 | + foreach (self::explodeRule($validations) as $validation) { |
|
68 | + $validation = self::parseStringRule($validation); |
|
69 | + |
|
70 | + if(isset($validation[0])){ |
|
71 | + |
|
72 | + $rule = $validation[0]; |
|
73 | + $values = $validation[1]; |
|
74 | + |
|
75 | + switch ($rule) { |
|
76 | + case 'required': |
|
77 | + if($blnSearch) { |
|
78 | + $attribute = null ; |
|
79 | + $attributeValue = null ; |
|
80 | + } |
|
81 | + else { |
|
82 | + $attribute = "required" ; |
|
83 | + $attributeValue = null ; |
|
84 | + } |
|
85 | 85 | |
86 | - break; |
|
86 | + break; |
|
87 | 87 | |
88 | - case 'max': |
|
89 | - case 'min': |
|
90 | - $attribute = $rule.'length' ; |
|
91 | - $attributeValue = $values[0] ; |
|
92 | - break; |
|
88 | + case 'max': |
|
89 | + case 'min': |
|
90 | + $attribute = $rule.'length' ; |
|
91 | + $attributeValue = $values[0] ; |
|
92 | + break; |
|
93 | 93 | |
94 | - default: |
|
95 | - $attribute = null ; |
|
96 | - $attributeValue = null ; |
|
97 | - break; |
|
98 | - } |
|
94 | + default: |
|
95 | + $attribute = null ; |
|
96 | + $attributeValue = null ; |
|
97 | + break; |
|
98 | + } |
|
99 | 99 | |
100 | - if($attribute) |
|
101 | - $validationsConverted[$attribute] = $attributeValue ; |
|
100 | + if($attribute) |
|
101 | + $validationsConverted[$attribute] = $attributeValue ; |
|
102 | 102 | |
103 | - } |
|
103 | + } |
|
104 | 104 | |
105 | - } |
|
105 | + } |
|
106 | 106 | |
107 | - return $validationsConverted ; |
|
108 | - } |
|
107 | + return $validationsConverted ; |
|
108 | + } |
|
109 | 109 | |
110 | 110 | } |
111 | 111 | \ No newline at end of file |
@@ -62,49 +62,49 @@ |
||
62 | 62 | * @param string $validations |
63 | 63 | * @return array |
64 | 64 | */ |
65 | - public static function convertValidations($validations, $blnSearch = false){ |
|
65 | + public static function convertValidations($validations, $blnSearch = false) { |
|
66 | 66 | $validationsConverted = []; |
67 | 67 | foreach (self::explodeRule($validations) as $validation) { |
68 | 68 | $validation = self::parseStringRule($validation); |
69 | 69 | |
70 | - if(isset($validation[0])){ |
|
70 | + if (isset($validation[0])) { |
|
71 | 71 | |
72 | 72 | $rule = $validation[0]; |
73 | 73 | $values = $validation[1]; |
74 | 74 | |
75 | 75 | switch ($rule) { |
76 | 76 | case 'required': |
77 | - if($blnSearch) { |
|
78 | - $attribute = null ; |
|
79 | - $attributeValue = null ; |
|
77 | + if ($blnSearch) { |
|
78 | + $attribute = null; |
|
79 | + $attributeValue = null; |
|
80 | 80 | } |
81 | 81 | else { |
82 | - $attribute = "required" ; |
|
83 | - $attributeValue = null ; |
|
82 | + $attribute = "required"; |
|
83 | + $attributeValue = null; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | break; |
87 | 87 | |
88 | 88 | case 'max': |
89 | 89 | case 'min': |
90 | - $attribute = $rule.'length' ; |
|
91 | - $attributeValue = $values[0] ; |
|
90 | + $attribute = $rule.'length'; |
|
91 | + $attributeValue = $values[0]; |
|
92 | 92 | break; |
93 | 93 | |
94 | 94 | default: |
95 | - $attribute = null ; |
|
96 | - $attributeValue = null ; |
|
95 | + $attribute = null; |
|
96 | + $attributeValue = null; |
|
97 | 97 | break; |
98 | 98 | } |
99 | 99 | |
100 | - if($attribute) |
|
101 | - $validationsConverted[$attribute] = $attributeValue ; |
|
100 | + if ($attribute) |
|
101 | + $validationsConverted[$attribute] = $attributeValue; |
|
102 | 102 | |
103 | 103 | } |
104 | 104 | |
105 | 105 | } |
106 | 106 | |
107 | - return $validationsConverted ; |
|
107 | + return $validationsConverted; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | } |
111 | 111 | \ No newline at end of file |
@@ -4,70 +4,70 @@ |
||
4 | 4 | |
5 | 5 | class CamelCase |
6 | 6 | { |
7 | - /** |
|
8 | - * Given an underscore_separated_string, this will convert the string |
|
9 | - * to CamelCaseNotation. Note that this will ignore any casing in the |
|
10 | - * underscore separated string. |
|
11 | - * |
|
12 | - * @param string $strString |
|
13 | - * @return string |
|
14 | - */ |
|
15 | - public static function convertToCamelCase($strString) { |
|
16 | - return str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($strString)))); |
|
17 | - } |
|
7 | + /** |
|
8 | + * Given an underscore_separated_string, this will convert the string |
|
9 | + * to CamelCaseNotation. Note that this will ignore any casing in the |
|
10 | + * underscore separated string. |
|
11 | + * |
|
12 | + * @param string $strString |
|
13 | + * @return string |
|
14 | + */ |
|
15 | + public static function convertToCamelCase($strString) { |
|
16 | + return str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($strString)))); |
|
17 | + } |
|
18 | 18 | |
19 | - public static function underscoreFromCamelCase($strName) { |
|
20 | - if (strlen($strName) == 0) return ''; |
|
19 | + public static function underscoreFromCamelCase($strName) { |
|
20 | + if (strlen($strName) == 0) return ''; |
|
21 | 21 | |
22 | - $strToReturn = self::FirstCharacter($strName); |
|
22 | + $strToReturn = self::FirstCharacter($strName); |
|
23 | 23 | |
24 | - for ($intIndex = 1; $intIndex < strlen($strName); $intIndex++) { |
|
25 | - $strChar = substr($strName, $intIndex, 1); |
|
26 | - if (strtoupper($strChar) == $strChar) |
|
27 | - $strToReturn .= '_' . $strChar; |
|
28 | - else |
|
29 | - $strToReturn .= $strChar; |
|
30 | - } |
|
24 | + for ($intIndex = 1; $intIndex < strlen($strName); $intIndex++) { |
|
25 | + $strChar = substr($strName, $intIndex, 1); |
|
26 | + if (strtoupper($strChar) == $strChar) |
|
27 | + $strToReturn .= '_' . $strChar; |
|
28 | + else |
|
29 | + $strToReturn .= $strChar; |
|
30 | + } |
|
31 | 31 | |
32 | - return strtolower($strToReturn); |
|
33 | - } |
|
32 | + return strtolower($strToReturn); |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Returns the first character of a given string, or null if the given |
|
37 | - * string is null. |
|
38 | - * @param string $strString |
|
39 | - * @return string the first character, or null |
|
40 | - */ |
|
41 | - public final static function firstCharacter($strString) { |
|
42 | - if (strlen($strString) > 0) |
|
43 | - return substr($strString, 0 , 1); |
|
44 | - else |
|
45 | - return null; |
|
46 | - } |
|
35 | + /** |
|
36 | + * Returns the first character of a given string, or null if the given |
|
37 | + * string is null. |
|
38 | + * @param string $strString |
|
39 | + * @return string the first character, or null |
|
40 | + */ |
|
41 | + public final static function firstCharacter($strString) { |
|
42 | + if (strlen($strString) > 0) |
|
43 | + return substr($strString, 0 , 1); |
|
44 | + else |
|
45 | + return null; |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | - public static function pluralize($strName) { |
|
50 | - // Special Rules go Here |
|
51 | - switch (true) { |
|
52 | - case (strtolower($strName) == 'play'): |
|
53 | - return $strName . 's'; |
|
54 | - } |
|
49 | + public static function pluralize($strName) { |
|
50 | + // Special Rules go Here |
|
51 | + switch (true) { |
|
52 | + case (strtolower($strName) == 'play'): |
|
53 | + return $strName . 's'; |
|
54 | + } |
|
55 | 55 | |
56 | - $intLength = strlen($strName); |
|
57 | - if (substr($strName, $intLength - 1) == "y") |
|
58 | - return substr($strName, 0, $intLength - 1) . "ies"; |
|
59 | - if (substr($strName, $intLength - 1) == "s") |
|
60 | - return $strName . "es"; |
|
61 | - if (substr($strName, $intLength - 1) == "x") |
|
62 | - return $strName . "es"; |
|
63 | - if (substr($strName, $intLength - 1) == "z") |
|
64 | - return $strName . "zes"; |
|
65 | - if (substr($strName, $intLength - 2) == "sh") |
|
66 | - return $strName . "es"; |
|
67 | - if (substr($strName, $intLength - 2) == "ch") |
|
68 | - return $strName . "es"; |
|
56 | + $intLength = strlen($strName); |
|
57 | + if (substr($strName, $intLength - 1) == "y") |
|
58 | + return substr($strName, 0, $intLength - 1) . "ies"; |
|
59 | + if (substr($strName, $intLength - 1) == "s") |
|
60 | + return $strName . "es"; |
|
61 | + if (substr($strName, $intLength - 1) == "x") |
|
62 | + return $strName . "es"; |
|
63 | + if (substr($strName, $intLength - 1) == "z") |
|
64 | + return $strName . "zes"; |
|
65 | + if (substr($strName, $intLength - 2) == "sh") |
|
66 | + return $strName . "es"; |
|
67 | + if (substr($strName, $intLength - 2) == "ch") |
|
68 | + return $strName . "es"; |
|
69 | 69 | |
70 | - return $strName . "s"; |
|
71 | - } |
|
70 | + return $strName . "s"; |
|
71 | + } |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | for ($intIndex = 1; $intIndex < strlen($strName); $intIndex++) { |
25 | 25 | $strChar = substr($strName, $intIndex, 1); |
26 | 26 | if (strtoupper($strChar) == $strChar) |
27 | - $strToReturn .= '_' . $strChar; |
|
27 | + $strToReturn .= '_'.$strChar; |
|
28 | 28 | else |
29 | 29 | $strToReturn .= $strChar; |
30 | 30 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public final static function firstCharacter($strString) { |
42 | 42 | if (strlen($strString) > 0) |
43 | - return substr($strString, 0 , 1); |
|
43 | + return substr($strString, 0, 1); |
|
44 | 44 | else |
45 | 45 | return null; |
46 | 46 | } |
@@ -50,24 +50,24 @@ discard block |
||
50 | 50 | // Special Rules go Here |
51 | 51 | switch (true) { |
52 | 52 | case (strtolower($strName) == 'play'): |
53 | - return $strName . 's'; |
|
53 | + return $strName.'s'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $intLength = strlen($strName); |
57 | 57 | if (substr($strName, $intLength - 1) == "y") |
58 | - return substr($strName, 0, $intLength - 1) . "ies"; |
|
58 | + return substr($strName, 0, $intLength - 1)."ies"; |
|
59 | 59 | if (substr($strName, $intLength - 1) == "s") |
60 | - return $strName . "es"; |
|
60 | + return $strName."es"; |
|
61 | 61 | if (substr($strName, $intLength - 1) == "x") |
62 | - return $strName . "es"; |
|
62 | + return $strName."es"; |
|
63 | 63 | if (substr($strName, $intLength - 1) == "z") |
64 | - return $strName . "zes"; |
|
64 | + return $strName."zes"; |
|
65 | 65 | if (substr($strName, $intLength - 2) == "sh") |
66 | - return $strName . "es"; |
|
66 | + return $strName."es"; |
|
67 | 67 | if (substr($strName, $intLength - 2) == "ch") |
68 | - return $strName . "es"; |
|
68 | + return $strName."es"; |
|
69 | 69 | |
70 | - return $strName . "s"; |
|
70 | + return $strName."s"; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | } |
74 | 74 | \ No newline at end of file |
@@ -4,29 +4,29 @@ |
||
4 | 4 | |
5 | 5 | class Arrays |
6 | 6 | { |
7 | - public static function moveElement($array, $toMove, $targetIndex) { |
|
8 | - if (count($array) == 1) |
|
9 | - return $array; |
|
10 | - if (is_int($toMove)) { |
|
11 | - $tmp = array_splice($array, $toMove, 1); |
|
12 | - array_splice($array, $targetIndex, 0, $tmp); |
|
13 | - $output = $array; |
|
14 | - } |
|
15 | - elseif (is_string($toMove)) { |
|
16 | - $indexToMove = array_search($toMove, array_keys($array)); |
|
17 | - $itemToMove = $array[$toMove]; |
|
18 | - array_splice($array, $indexToMove, 1); |
|
19 | - $i = 0; |
|
20 | - $output = Array(); |
|
21 | - foreach($array as $key => $item) { |
|
22 | - if ($i == $targetIndex) { |
|
23 | - $output[$toMove] = $itemToMove; |
|
24 | - } |
|
25 | - $output[$key] = $item; |
|
26 | - $i++; |
|
27 | - } |
|
28 | - } |
|
29 | - return $output; |
|
30 | - } |
|
7 | + public static function moveElement($array, $toMove, $targetIndex) { |
|
8 | + if (count($array) == 1) |
|
9 | + return $array; |
|
10 | + if (is_int($toMove)) { |
|
11 | + $tmp = array_splice($array, $toMove, 1); |
|
12 | + array_splice($array, $targetIndex, 0, $tmp); |
|
13 | + $output = $array; |
|
14 | + } |
|
15 | + elseif (is_string($toMove)) { |
|
16 | + $indexToMove = array_search($toMove, array_keys($array)); |
|
17 | + $itemToMove = $array[$toMove]; |
|
18 | + array_splice($array, $indexToMove, 1); |
|
19 | + $i = 0; |
|
20 | + $output = Array(); |
|
21 | + foreach($array as $key => $item) { |
|
22 | + if ($i == $targetIndex) { |
|
23 | + $output[$toMove] = $itemToMove; |
|
24 | + } |
|
25 | + $output[$key] = $item; |
|
26 | + $i++; |
|
27 | + } |
|
28 | + } |
|
29 | + return $output; |
|
30 | + } |
|
31 | 31 | } |
32 | 32 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | array_splice($array, $indexToMove, 1); |
19 | 19 | $i = 0; |
20 | 20 | $output = Array(); |
21 | - foreach($array as $key => $item) { |
|
21 | + foreach ($array as $key => $item) { |
|
22 | 22 | if ($i == $targetIndex) { |
23 | 23 | $output[$toMove] = $itemToMove; |
24 | 24 | } |
@@ -13,60 +13,60 @@ |
||
13 | 13 | |
14 | 14 | class BuildCommand extends Command |
15 | 15 | { |
16 | - protected $signature = 'scaffolder:build {app=webapp}'; |
|
16 | + protected $signature = 'scaffolder:build {app=webapp}'; |
|
17 | 17 | |
18 | - protected $description = 'Build the generated code to public folder'; |
|
18 | + protected $description = 'Build the generated code to public folder'; |
|
19 | 19 | |
20 | - /** |
|
21 | - * Execute the Command. |
|
22 | - */ |
|
23 | - public function handle() |
|
24 | - { |
|
20 | + /** |
|
21 | + * Execute the Command. |
|
22 | + */ |
|
23 | + public function handle() |
|
24 | + { |
|
25 | 25 | |
26 | 26 | |
27 | - switch ($this->argument('app')) { |
|
28 | - case 'webapp': |
|
27 | + switch ($this->argument('app')) { |
|
28 | + case 'webapp': |
|
29 | 29 | |
30 | - $this->cleanPublicFolder(); |
|
30 | + $this->cleanPublicFolder(); |
|
31 | 31 | |
32 | - $gulpCommand = sprintf('gulp build --cwd "%s/codificar/scaffolder-theme-material/"', base_path('vendor')); |
|
32 | + $gulpCommand = sprintf('gulp build --cwd "%s/codificar/scaffolder-theme-material/"', base_path('vendor')); |
|
33 | 33 | |
34 | - //$this->info('- gulpCommand: '. $gulpCommand); |
|
34 | + //$this->info('- gulpCommand: '. $gulpCommand); |
|
35 | 35 | |
36 | - $handle = popen($gulpCommand, 'r'); |
|
36 | + $handle = popen($gulpCommand, 'r'); |
|
37 | 37 | |
38 | - while(!feof($handle)) |
|
39 | - { |
|
40 | - // send the current file part to the browser |
|
41 | - $this->info(fread($handle, 1024)); |
|
42 | - } |
|
38 | + while(!feof($handle)) |
|
39 | + { |
|
40 | + // send the current file part to the browser |
|
41 | + $this->info(fread($handle, 1024)); |
|
42 | + } |
|
43 | 43 | |
44 | - fclose($handle); |
|
44 | + fclose($handle); |
|
45 | 45 | |
46 | - // php artisan serve |
|
47 | - $this->call('serve'); |
|
46 | + // php artisan serve |
|
47 | + $this->call('serve'); |
|
48 | 48 | |
49 | - break; |
|
49 | + break; |
|
50 | 50 | |
51 | - default: |
|
52 | - $this->info('Invalid arguments'); |
|
53 | - break; |
|
54 | - } |
|
51 | + default: |
|
52 | + $this->info('Invalid arguments'); |
|
53 | + break; |
|
54 | + } |
|
55 | 55 | |
56 | - } |
|
56 | + } |
|
57 | 57 | |
58 | - private function cleanPublicFolder(){ |
|
59 | - $this->info('Cleaning public directory'); |
|
58 | + private function cleanPublicFolder(){ |
|
59 | + $this->info('Cleaning public directory'); |
|
60 | 60 | |
61 | - File::deleteDirectory(sprintf("%s/app", base_path('public'))); |
|
62 | - File::deleteDirectory(sprintf("%s/assets", base_path('public'))); |
|
63 | - File::deleteDirectory(sprintf("%s/fonts", base_path('public'))); |
|
64 | - File::deleteDirectory(sprintf("%s/maps", base_path('public'))); |
|
65 | - File::deleteDirectory(sprintf("%s/scripts", base_path('public'))); |
|
66 | - File::deleteDirectory(sprintf("%s/styles", base_path('public'))); |
|
61 | + File::deleteDirectory(sprintf("%s/app", base_path('public'))); |
|
62 | + File::deleteDirectory(sprintf("%s/assets", base_path('public'))); |
|
63 | + File::deleteDirectory(sprintf("%s/fonts", base_path('public'))); |
|
64 | + File::deleteDirectory(sprintf("%s/maps", base_path('public'))); |
|
65 | + File::deleteDirectory(sprintf("%s/scripts", base_path('public'))); |
|
66 | + File::deleteDirectory(sprintf("%s/styles", base_path('public'))); |
|
67 | 67 | |
68 | - File::delete(sprintf("%s/index.html", base_path('public'))); |
|
69 | - } |
|
68 | + File::delete(sprintf("%s/index.html", base_path('public'))); |
|
69 | + } |
|
70 | 70 | |
71 | 71 | |
72 | 72 | } |
73 | 73 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use Illuminate\Support\Facades\File; |
7 | 7 | |
8 | -use stdClass ; |
|
8 | +use stdClass; |
|
9 | 9 | |
10 | 10 | // Support classes |
11 | 11 | use Scaffolder\Support\Directory; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $handle = popen($gulpCommand, 'r'); |
37 | 37 | |
38 | - while(!feof($handle)) |
|
38 | + while (!feof($handle)) |
|
39 | 39 | { |
40 | 40 | // send the current file part to the browser |
41 | 41 | $this->info(fread($handle, 1024)); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | } |
57 | 57 | |
58 | - private function cleanPublicFolder(){ |
|
58 | + private function cleanPublicFolder() { |
|
59 | 59 | $this->info('Cleaning public directory'); |
60 | 60 | |
61 | 61 | File::deleteDirectory(sprintf("%s/app", base_path('public'))); |
@@ -17,143 +17,143 @@ |
||
17 | 17 | |
18 | 18 | class ServeCommand extends Command |
19 | 19 | { |
20 | - protected $signature = 'scaffolder:serve {app=webapp} {--o|overwrite : Overwrite generated files} {--g|generate : Generate files }'; |
|
20 | + protected $signature = 'scaffolder:serve {app=webapp} {--o|overwrite : Overwrite generated files} {--g|generate : Generate files }'; |
|
21 | 21 | |
22 | - protected $description = 'Serve code for development purpose'; |
|
22 | + protected $description = 'Serve code for development purpose'; |
|
23 | 23 | |
24 | - // app config var |
|
25 | - private $scaffolderConfig ; |
|
24 | + // app config var |
|
25 | + private $scaffolderConfig ; |
|
26 | 26 | |
27 | - /** |
|
28 | - * Execute the Command. |
|
29 | - */ |
|
30 | - public function handle() |
|
31 | - { |
|
32 | - // Get app config |
|
33 | - $this->getScaffolderConfig(); |
|
27 | + /** |
|
28 | + * Execute the Command. |
|
29 | + */ |
|
30 | + public function handle() |
|
31 | + { |
|
32 | + // Get app config |
|
33 | + $this->getScaffolderConfig(); |
|
34 | 34 | |
35 | - $overwrite = false; |
|
35 | + $overwrite = false; |
|
36 | 36 | |
37 | - if($this->option('overwrite')) |
|
38 | - $overwrite = true; |
|
37 | + if($this->option('overwrite')) |
|
38 | + $overwrite = true; |
|
39 | 39 | |
40 | - $generate = false; |
|
40 | + $generate = false; |
|
41 | 41 | |
42 | - if($this->option('generate')) |
|
43 | - $generate = true; |
|
42 | + if($this->option('generate')) |
|
43 | + $generate = true; |
|
44 | 44 | |
45 | 45 | |
46 | - switch ($this->argument('app')) { |
|
47 | - case 'webapp': |
|
46 | + switch ($this->argument('app')) { |
|
47 | + case 'webapp': |
|
48 | 48 | |
49 | - // gera código somente se houver a opcao |
|
50 | - if($generate) { |
|
51 | - // Gera codigo da api |
|
52 | - $this->call('scaffolder:generate', array('app' => 'api', '-c' => 'clear-all')); |
|
49 | + // gera código somente se houver a opcao |
|
50 | + if($generate) { |
|
51 | + // Gera codigo da api |
|
52 | + $this->call('scaffolder:generate', array('app' => 'api', '-c' => 'clear-all')); |
|
53 | 53 | |
54 | - // Se parametro --overwrite selecionado, copia arquivos para seu respectivo destino |
|
55 | - $this->copyApiFiles($overwrite); |
|
54 | + // Se parametro --overwrite selecionado, copia arquivos para seu respectivo destino |
|
55 | + $this->copyApiFiles($overwrite); |
|
56 | 56 | |
57 | - // Gera codigo da pasta webapp |
|
58 | - $this->call('scaffolder:generate', array('app' => 'angularjs', '-c' => 'clear-all')); |
|
57 | + // Gera codigo da pasta webapp |
|
58 | + $this->call('scaffolder:generate', array('app' => 'angularjs', '-c' => 'clear-all')); |
|
59 | 59 | |
60 | - // Se parametro --overwrite selecionado, copia arquivos para seu respectivo destino |
|
61 | - $this->copyAngularjsFiles($overwrite); |
|
62 | - } |
|
60 | + // Se parametro --overwrite selecionado, copia arquivos para seu respectivo destino |
|
61 | + $this->copyAngularjsFiles($overwrite); |
|
62 | + } |
|
63 | 63 | |
64 | - $gulpCommand = sprintf('gulp serve --cwd "%s/codificar/scaffolder-theme-material/" > null', base_path('vendor')); |
|
64 | + $gulpCommand = sprintf('gulp serve --cwd "%s/codificar/scaffolder-theme-material/" > null', base_path('vendor')); |
|
65 | 65 | |
66 | - $this->info('Running gulp in serve mode, wait your browser open...'); |
|
67 | - //$handle = popen($gulpCommand, 'r'); |
|
66 | + $this->info('Running gulp in serve mode, wait your browser open...'); |
|
67 | + //$handle = popen($gulpCommand, 'r'); |
|
68 | 68 | |
69 | - $this->launchBackgroundProcess($gulpCommand); |
|
69 | + $this->launchBackgroundProcess($gulpCommand); |
|
70 | 70 | |
71 | - // php artisan serve |
|
72 | - $this->call('serve'); |
|
71 | + // php artisan serve |
|
72 | + $this->call('serve'); |
|
73 | 73 | |
74 | - break; |
|
74 | + break; |
|
75 | 75 | |
76 | - default: |
|
77 | - $this->info('Invalid arguments'); |
|
78 | - break; |
|
79 | - } |
|
76 | + default: |
|
77 | + $this->info('Invalid arguments'); |
|
78 | + break; |
|
79 | + } |
|
80 | 80 | |
81 | - } |
|
82 | - |
|
83 | - /** |
|
84 | - * Launch Background Process |
|
85 | - * |
|
86 | - * Launches a background process (note, provides no security itself, $call must be sanitized prior to use) |
|
87 | - * @param string $call the system call to make |
|
88 | - * @author raccettura |
|
89 | - */ |
|
90 | - private function launchBackgroundProcess($call) { |
|
81 | + } |
|
82 | + |
|
83 | + /** |
|
84 | + * Launch Background Process |
|
85 | + * |
|
86 | + * Launches a background process (note, provides no security itself, $call must be sanitized prior to use) |
|
87 | + * @param string $call the system call to make |
|
88 | + * @author raccettura |
|
89 | + */ |
|
90 | + private function launchBackgroundProcess($call) { |
|
91 | 91 | |
92 | - // Windows |
|
93 | - if($this->is_windows()){ |
|
94 | - pclose(popen('start /b '.$call, 'r')); |
|
95 | - } |
|
92 | + // Windows |
|
93 | + if($this->is_windows()){ |
|
94 | + pclose(popen('start /b '.$call, 'r')); |
|
95 | + } |
|
96 | 96 | |
97 | - // Some sort of UNIX |
|
98 | - else { |
|
99 | - pclose(popen($call.' /dev/null &', 'r')); |
|
100 | - } |
|
101 | - return true; |
|
102 | - } |
|
97 | + // Some sort of UNIX |
|
98 | + else { |
|
99 | + pclose(popen($call.' /dev/null &', 'r')); |
|
100 | + } |
|
101 | + return true; |
|
102 | + } |
|
103 | 103 | |
104 | 104 | |
105 | - /** |
|
106 | - * Is Windows |
|
107 | - * |
|
108 | - * Tells if we are running on Windows Platform |
|
109 | - * @author raccettura |
|
110 | - */ |
|
111 | - private function is_windows(){ |
|
112 | - if(PHP_OS == 'WINNT' || PHP_OS == 'WIN32'){ |
|
113 | - return true; |
|
114 | - } |
|
115 | - return false; |
|
116 | - } |
|
117 | - |
|
118 | - |
|
119 | - public function copyApiFiles($overwrite) { |
|
120 | - |
|
121 | - $command = sprintf('cp -r %s "%s/." "%s"', |
|
122 | - (!$overwrite ? ' -u' : null) , |
|
123 | - PathParser::parse($this->scaffolderConfig->generators->api->paths->base), |
|
124 | - base_path()); |
|
105 | + /** |
|
106 | + * Is Windows |
|
107 | + * |
|
108 | + * Tells if we are running on Windows Platform |
|
109 | + * @author raccettura |
|
110 | + */ |
|
111 | + private function is_windows(){ |
|
112 | + if(PHP_OS == 'WINNT' || PHP_OS == 'WIN32'){ |
|
113 | + return true; |
|
114 | + } |
|
115 | + return false; |
|
116 | + } |
|
117 | + |
|
118 | + |
|
119 | + public function copyApiFiles($overwrite) { |
|
120 | + |
|
121 | + $command = sprintf('cp -r %s "%s/." "%s"', |
|
122 | + (!$overwrite ? ' -u' : null) , |
|
123 | + PathParser::parse($this->scaffolderConfig->generators->api->paths->base), |
|
124 | + base_path()); |
|
125 | 125 | |
126 | - shell_exec($command); |
|
126 | + shell_exec($command); |
|
127 | 127 | |
128 | - $this->info('- Api files copied'); |
|
129 | - } |
|
128 | + $this->info('- Api files copied'); |
|
129 | + } |
|
130 | 130 | |
131 | - public function copyAngularjsFiles($overwrite) { |
|
131 | + public function copyAngularjsFiles($overwrite) { |
|
132 | 132 | |
133 | - // resource angular js path |
|
134 | - Directory::createIfNotExists(PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->resources), 0755, true); |
|
133 | + // resource angular js path |
|
134 | + Directory::createIfNotExists(PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->resources), 0755, true); |
|
135 | 135 | |
136 | - // copying page files |
|
137 | - $command = sprintf('cp -r %s "%s/." "%s/"', |
|
138 | - (!$overwrite ? ' -u' : null) , |
|
139 | - PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->index), |
|
140 | - PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->resources)); |
|
136 | + // copying page files |
|
137 | + $command = sprintf('cp -r %s "%s/." "%s/"', |
|
138 | + (!$overwrite ? ' -u' : null) , |
|
139 | + PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->index), |
|
140 | + PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->resources)); |
|
141 | 141 | |
142 | - shell_exec($command); |
|
142 | + shell_exec($command); |
|
143 | 143 | |
144 | - $this->info('- Angularjs files copied'); |
|
145 | - } |
|
144 | + $this->info('- Angularjs files copied'); |
|
145 | + } |
|
146 | 146 | |
147 | 147 | |
148 | - /** |
|
149 | - * Get the app.json configuration and parse to an object |
|
150 | - * |
|
151 | - * @return void |
|
152 | - */ |
|
153 | - private function getScaffolderConfig(){ |
|
154 | - // Get app config |
|
155 | - $this->scaffolderConfig = Json::decodeFile(base_path('scaffolder-config/app.json')); |
|
148 | + /** |
|
149 | + * Get the app.json configuration and parse to an object |
|
150 | + * |
|
151 | + * @return void |
|
152 | + */ |
|
153 | + private function getScaffolderConfig(){ |
|
154 | + // Get app config |
|
155 | + $this->scaffolderConfig = Json::decodeFile(base_path('scaffolder-config/app.json')); |
|
156 | 156 | |
157 | - } |
|
157 | + } |
|
158 | 158 | |
159 | 159 | } |
160 | 160 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Illuminate\Console\Command; |
6 | 6 | use Illuminate\Support\Facades\File; |
7 | 7 | |
8 | -use stdClass ; |
|
8 | +use stdClass; |
|
9 | 9 | |
10 | 10 | // Support classes |
11 | 11 | use Scaffolder\Support\Directory; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | protected $description = 'Serve code for development purpose'; |
23 | 23 | |
24 | 24 | // app config var |
25 | - private $scaffolderConfig ; |
|
25 | + private $scaffolderConfig; |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Execute the Command. |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | |
35 | 35 | $overwrite = false; |
36 | 36 | |
37 | - if($this->option('overwrite')) |
|
37 | + if ($this->option('overwrite')) |
|
38 | 38 | $overwrite = true; |
39 | 39 | |
40 | 40 | $generate = false; |
41 | 41 | |
42 | - if($this->option('generate')) |
|
42 | + if ($this->option('generate')) |
|
43 | 43 | $generate = true; |
44 | 44 | |
45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | case 'webapp': |
48 | 48 | |
49 | 49 | // gera código somente se houver a opcao |
50 | - if($generate) { |
|
50 | + if ($generate) { |
|
51 | 51 | // Gera codigo da api |
52 | 52 | $this->call('scaffolder:generate', array('app' => 'api', '-c' => 'clear-all')); |
53 | 53 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | private function launchBackgroundProcess($call) { |
91 | 91 | |
92 | 92 | // Windows |
93 | - if($this->is_windows()){ |
|
93 | + if ($this->is_windows()) { |
|
94 | 94 | pclose(popen('start /b '.$call, 'r')); |
95 | 95 | } |
96 | 96 | |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | * Tells if we are running on Windows Platform |
109 | 109 | * @author raccettura |
110 | 110 | */ |
111 | - private function is_windows(){ |
|
112 | - if(PHP_OS == 'WINNT' || PHP_OS == 'WIN32'){ |
|
111 | + private function is_windows() { |
|
112 | + if (PHP_OS == 'WINNT' || PHP_OS == 'WIN32') { |
|
113 | 113 | return true; |
114 | 114 | } |
115 | 115 | return false; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function copyApiFiles($overwrite) { |
120 | 120 | |
121 | 121 | $command = sprintf('cp -r %s "%s/." "%s"', |
122 | - (!$overwrite ? ' -u' : null) , |
|
122 | + (!$overwrite ? ' -u' : null), |
|
123 | 123 | PathParser::parse($this->scaffolderConfig->generators->api->paths->base), |
124 | 124 | base_path()); |
125 | 125 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | // copying page files |
137 | 137 | $command = sprintf('cp -r %s "%s/." "%s/"', |
138 | - (!$overwrite ? ' -u' : null) , |
|
138 | + (!$overwrite ? ' -u' : null), |
|
139 | 139 | PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->index), |
140 | 140 | PathParser::parse($this->scaffolderConfig->generators->angularjs->paths->resources)); |
141 | 141 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return void |
152 | 152 | */ |
153 | - private function getScaffolderConfig(){ |
|
153 | + private function getScaffolderConfig() { |
|
154 | 154 | // Get app config |
155 | 155 | $this->scaffolderConfig = Json::decodeFile(base_path('scaffolder-config/app.json')); |
156 | 156 |