@@ -77,8 +77,7 @@ discard block |
||
77 | 77 | if($blnSearch) { |
78 | 78 | $attribute = null ; |
79 | 79 | $attributeValue = null ; |
80 | - } |
|
81 | - else { |
|
80 | + } else { |
|
82 | 81 | $attribute = "required" ; |
83 | 82 | $attributeValue = null ; |
84 | 83 | } |
@@ -97,8 +96,9 @@ discard block |
||
97 | 96 | break; |
98 | 97 | } |
99 | 98 | |
100 | - if($attribute) |
|
101 | - $validationsConverted[$attribute] = $attributeValue ; |
|
99 | + if($attribute) { |
|
100 | + $validationsConverted[$attribute] = $attributeValue ; |
|
101 | + } |
|
102 | 102 | |
103 | 103 | } |
104 | 104 |
@@ -17,16 +17,19 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | public static function underscoreFromCamelCase($strName) { |
20 | - if (strlen($strName) == 0) return ''; |
|
20 | + if (strlen($strName) == 0) { |
|
21 | + return ''; |
|
22 | + } |
|
21 | 23 | |
22 | 24 | $strToReturn = self::FirstCharacter($strName); |
23 | 25 | |
24 | 26 | for ($intIndex = 1; $intIndex < strlen($strName); $intIndex++) { |
25 | 27 | $strChar = substr($strName, $intIndex, 1); |
26 | - if (strtoupper($strChar) == $strChar) |
|
27 | - $strToReturn .= '_' . $strChar; |
|
28 | - else |
|
29 | - $strToReturn .= $strChar; |
|
28 | + if (strtoupper($strChar) == $strChar) { |
|
29 | + $strToReturn .= '_' . $strChar; |
|
30 | + } else { |
|
31 | + $strToReturn .= $strChar; |
|
32 | + } |
|
30 | 33 | } |
31 | 34 | |
32 | 35 | return strtolower($strToReturn); |
@@ -39,10 +42,11 @@ discard block |
||
39 | 42 | * @return string the first character, or null |
40 | 43 | */ |
41 | 44 | public final static function firstCharacter($strString) { |
42 | - if (strlen($strString) > 0) |
|
43 | - return substr($strString, 0 , 1); |
|
44 | - else |
|
45 | - return null; |
|
45 | + if (strlen($strString) > 0) { |
|
46 | + return substr($strString, 0 , 1); |
|
47 | + } else { |
|
48 | + return null; |
|
49 | + } |
|
46 | 50 | } |
47 | 51 | |
48 | 52 | |
@@ -54,18 +58,24 @@ discard block |
||
54 | 58 | } |
55 | 59 | |
56 | 60 | $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"; |
|
61 | + if (substr($strName, $intLength - 1) == "y") { |
|
62 | + return substr($strName, 0, $intLength - 1) . "ies"; |
|
63 | + } |
|
64 | + if (substr($strName, $intLength - 1) == "s") { |
|
65 | + return $strName . "es"; |
|
66 | + } |
|
67 | + if (substr($strName, $intLength - 1) == "x") { |
|
68 | + return $strName . "es"; |
|
69 | + } |
|
70 | + if (substr($strName, $intLength - 1) == "z") { |
|
71 | + return $strName . "zes"; |
|
72 | + } |
|
73 | + if (substr($strName, $intLength - 2) == "sh") { |
|
74 | + return $strName . "es"; |
|
75 | + } |
|
76 | + if (substr($strName, $intLength - 2) == "ch") { |
|
77 | + return $strName . "es"; |
|
78 | + } |
|
69 | 79 | |
70 | 80 | return $strName . "s"; |
71 | 81 | } |
@@ -5,14 +5,14 @@ |
||
5 | 5 | class Arrays |
6 | 6 | { |
7 | 7 | public static function moveElement($array, $toMove, $targetIndex) { |
8 | - if (count($array) == 1) |
|
9 | - return $array; |
|
8 | + if (count($array) == 1) { |
|
9 | + return $array; |
|
10 | + } |
|
10 | 11 | if (is_int($toMove)) { |
11 | 12 | $tmp = array_splice($array, $toMove, 1); |
12 | 13 | array_splice($array, $targetIndex, 0, $tmp); |
13 | 14 | $output = $array; |
14 | - } |
|
15 | - elseif (is_string($toMove)) { |
|
15 | + } elseif (is_string($toMove)) { |
|
16 | 16 | $indexToMove = array_search($toMove, array_keys($array)); |
17 | 17 | $itemToMove = $array[$toMove]; |
18 | 18 | array_splice($array, $indexToMove, 1); |
@@ -34,13 +34,15 @@ |
||
34 | 34 | |
35 | 35 | $overwrite = false; |
36 | 36 | |
37 | - if($this->option('overwrite')) |
|
38 | - $overwrite = true; |
|
37 | + if($this->option('overwrite')) { |
|
38 | + $overwrite = true; |
|
39 | + } |
|
39 | 40 | |
40 | 41 | $generate = false; |
41 | 42 | |
42 | - if($this->option('generate')) |
|
43 | - $generate = true; |
|
43 | + if($this->option('generate')) { |
|
44 | + $generate = true; |
|
45 | + } |
|
44 | 46 | |
45 | 47 | |
46 | 48 | switch ($this->argument('app')) { |
@@ -289,8 +289,9 @@ |
||
289 | 289 | //array_push($listChooseColumnsCompilerOutput, $listChooseColumnsCompiler->compile()); |
290 | 290 | |
291 | 291 | $compiledIndexes .= $indexModuleCompiler->replaceResource($modelData); |
292 | - if ($intKey < count($modelsData)) |
|
293 | - $compiledIndexes .= ","; |
|
292 | + if ($intKey < count($modelsData)) { |
|
293 | + $compiledIndexes .= ","; |
|
294 | + } |
|
294 | 295 | |
295 | 296 | $intKey++; |
296 | 297 | // Advance progress |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if (File::exists(base_path('scaffolder-config/cache/view_create_' . $hash . self::CACHE_EXT))) |
31 | 31 | { |
32 | 32 | return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash)); |
33 | - } |
|
34 | - else |
|
33 | + } else |
|
35 | 34 | { |
36 | 35 | $this->stub = $stub; |
37 | 36 | |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | if ($fileToCompile->cached) |
67 | 66 | { |
68 | 67 | File::copy(base_path('scaffolder-config/cache/view_create_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
69 | - } |
|
70 | - else |
|
68 | + } else |
|
71 | 69 | { |
72 | 70 | File::put(base_path('scaffolder-config/cache/view_create_' . $fileToCompile->hash . self::CACHE_EXT), $compiled); |
73 | 71 | File::copy(base_path('scaffolder-config/cache/view_create_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
@@ -94,8 +92,7 @@ discard block |
||
94 | 92 | { |
95 | 93 | $fields .= sprintf(self::getInputFor($field) . PHP_EOL, $field->name); |
96 | 94 | $firstIteration = false; |
97 | - } |
|
98 | - else |
|
95 | + } else |
|
99 | 96 | { |
100 | 97 | $fields .= sprintf("\t" . self::getInputFor($field) . PHP_EOL, $field->name); |
101 | 98 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if (File::exists(base_path('scaffolder-config/cache/view_edit_' . $hash . self::CACHE_EXT))) |
31 | 31 | { |
32 | 32 | return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash)); |
33 | - } |
|
34 | - else |
|
33 | + } else |
|
35 | 34 | { |
36 | 35 | $this->stub = $stub; |
37 | 36 | |
@@ -67,8 +66,7 @@ discard block |
||
67 | 66 | if ($fileToCompile->cached) |
68 | 67 | { |
69 | 68 | File::copy(base_path('scaffolder-config/cache/view_edit_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
70 | - } |
|
71 | - else |
|
69 | + } else |
|
72 | 70 | { |
73 | 71 | File::put(base_path('scaffolder-config/cache/view_edit_' . $fileToCompile->hash . self::CACHE_EXT), $compiled); |
74 | 72 | File::copy(base_path('scaffolder-config/cache/view_edit_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
@@ -95,8 +93,7 @@ discard block |
||
95 | 93 | { |
96 | 94 | $fields .= sprintf(self::getInputFor($field) . PHP_EOL, $field->name); |
97 | 95 | $firstIteration = false; |
98 | - } |
|
99 | - else |
|
96 | + } else |
|
100 | 97 | { |
101 | 98 | $fields .= sprintf("\t" . self::getInputFor($field) . PHP_EOL, $field->name); |
102 | 99 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if (File::exists(base_path('scaffolder-config/cache/view_create_' . $hash . self::CACHE_EXT))) |
31 | 31 | { |
32 | 32 | return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash)); |
33 | - } |
|
34 | - else |
|
33 | + } else |
|
35 | 34 | { |
36 | 35 | $this->stub = $stub; |
37 | 36 | |
@@ -66,8 +65,7 @@ discard block |
||
66 | 65 | if ($fileToCompile->cached) |
67 | 66 | { |
68 | 67 | File::copy(base_path('scaffolder-config/cache/view_create_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
69 | - } |
|
70 | - else |
|
68 | + } else |
|
71 | 69 | { |
72 | 70 | File::put(base_path('scaffolder-config/cache/view_create_' . $fileToCompile->hash . self::CACHE_EXT), $compiled); |
73 | 71 | File::copy(base_path('scaffolder-config/cache/view_create_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
@@ -94,8 +92,7 @@ discard block |
||
94 | 92 | { |
95 | 93 | $fields .= sprintf(self::getInputFor($field) . PHP_EOL, $field->name); |
96 | 94 | $firstIteration = false; |
97 | - } |
|
98 | - else |
|
95 | + } else |
|
99 | 96 | { |
100 | 97 | $fields .= sprintf("\t" . self::getInputFor($field) . PHP_EOL, $field->name); |
101 | 98 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if (File::exists(base_path('scaffolder-config/cache/view_edit_' . $hash . self::CACHE_EXT))) |
31 | 31 | { |
32 | 32 | return $this->store($modelName, $scaffolderConfig, '', new FileToCompile(true, $hash)); |
33 | - } |
|
34 | - else |
|
33 | + } else |
|
35 | 34 | { |
36 | 35 | $this->stub = $stub; |
37 | 36 | |
@@ -67,8 +66,7 @@ discard block |
||
67 | 66 | if ($fileToCompile->cached) |
68 | 67 | { |
69 | 68 | File::copy(base_path('scaffolder-config/cache/view_edit_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
70 | - } |
|
71 | - else |
|
69 | + } else |
|
72 | 70 | { |
73 | 71 | File::put(base_path('scaffolder-config/cache/view_edit_' . $fileToCompile->hash . self::CACHE_EXT), $compiled); |
74 | 72 | File::copy(base_path('scaffolder-config/cache/view_edit_' . $fileToCompile->hash . self::CACHE_EXT), $path); |
@@ -95,8 +93,7 @@ discard block |
||
95 | 93 | { |
96 | 94 | $fields .= sprintf(self::getInputFor($field) . PHP_EOL, $field->name); |
97 | 95 | $firstIteration = false; |
98 | - } |
|
99 | - else |
|
96 | + } else |
|
100 | 97 | { |
101 | 98 | $fields .= sprintf("\t" . self::getInputFor($field) . PHP_EOL, $field->name); |
102 | 99 | } |