@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | } |
75 | 75 | $rules = []; |
76 | 76 | foreach ($types as $type => $columns) { |
77 | - $rules[] = "[['" . implode("', '", $columns) . "'], '$type']"; |
|
77 | + $rules[] = "[['".implode("', '", $columns)."'], '$type']"; |
|
78 | 78 | } |
79 | 79 | foreach ($lengths as $length => $columns) { |
80 | - $rules[] = "[['" . implode("', '", $columns) . "'], 'string', 'max' => $length]"; |
|
80 | + $rules[] = "[['".implode("', '", $columns)."'], 'string', 'max' => $length]"; |
|
81 | 81 | } |
82 | 82 | $db = $this->getDbConnection(); |
83 | 83 | // Unique indexes rules |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | if (!$this->isColumnAutoIncremental($table, $uniqueColumns)) { |
89 | 89 | $attributesCount = count($uniqueColumns); |
90 | 90 | if ($attributesCount === 1) { |
91 | - $rules[] = "[['" . $uniqueColumns[0] . "'], 'unique']"; |
|
91 | + $rules[] = "[['".$uniqueColumns[0]."'], 'unique']"; |
|
92 | 92 | } elseif ($attributesCount > 1) { |
93 | 93 | $labels = array_intersect_key($this->generateLabels($table), array_flip($uniqueColumns)); |
94 | 94 | $lastLabel = array_pop($labels); |
95 | 95 | $columnsList = implode("', '", $uniqueColumns); |
96 | - $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of " . implode(', ', $labels) . " and $lastLabel has already been taken.']"; |
|
96 | + $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of ".implode(', ', $labels)." and $lastLabel has already been taken.']"; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $fullTableName = $tableName; |
137 | 137 | if (($pos = strrpos($tableName, '.')) !== false) { |
138 | 138 | if (($useSchemaName === null && $this->useSchemaName) || $useSchemaName) { |
139 | - $schemaName = substr($tableName, 0, $pos) . '_'; |
|
139 | + $schemaName = substr($tableName, 0, $pos).'_'; |
|
140 | 140 | } |
141 | 141 | $tableName = substr($tableName, $pos + 1); |
142 | 142 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (($pos = strrpos($pattern, '.')) !== false) { |
150 | 150 | $pattern = substr($pattern, $pos + 1); |
151 | 151 | } |
152 | - $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/'; |
|
152 | + $patterns[] = '/^'.str_replace('*', '(\w+)', $pattern).'$/'; |
|
153 | 153 | } |
154 | 154 | $className = $tableName; |
155 | 155 | foreach ($patterns as $pattern) { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } else { |
194 | 194 | $label = Inflector::camel2words($column->name); |
195 | 195 | if (!empty($label) && substr_compare($label, ' id', -3, 3, true) === 0) { |
196 | - $label = substr($label, 0, -3) . ' ID'; |
|
196 | + $label = substr($label, 0, -3).' ID'; |
|
197 | 197 | } |
198 | 198 | $labels[$column->name] = $label; |
199 | 199 | } |
@@ -106,23 +106,23 @@ discard block |
||
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | - $appModulesFolder = Yii::$app->basePath . DIRECTORY_SEPARATOR . 'modules'; |
|
110 | - $moduleFolder = $appModulesFolder . DIRECTORY_SEPARATOR . $moduleName; |
|
109 | + $appModulesFolder = Yii::$app->basePath.DIRECTORY_SEPARATOR.'modules'; |
|
110 | + $moduleFolder = $appModulesFolder.DIRECTORY_SEPARATOR.$moduleName; |
|
111 | 111 | |
112 | 112 | if (file_exists($moduleFolder)) { |
113 | - return $this->outputError("The folder " . $moduleFolder . " exists already."); |
|
113 | + return $this->outputError("The folder ".$moduleFolder." exists already."); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $folders = [ |
117 | 117 | 'basePath' => $moduleFolder, |
118 | - 'adminPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin', |
|
119 | - 'adminAwsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'aws', |
|
120 | - 'adminMigrationPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'migrations', |
|
121 | - 'frontendPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend', |
|
122 | - 'frontendBlocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'blocks', |
|
123 | - 'frontendControllersPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'controllers', |
|
124 | - 'frontendViewsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'views', |
|
125 | - 'modelsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'models', |
|
118 | + 'adminPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin', |
|
119 | + 'adminAwsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'aws', |
|
120 | + 'adminMigrationPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'migrations', |
|
121 | + 'frontendPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend', |
|
122 | + 'frontendBlocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'blocks', |
|
123 | + 'frontendControllersPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'controllers', |
|
124 | + 'frontendViewsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'views', |
|
125 | + 'modelsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'models', |
|
126 | 126 | ]; |
127 | 127 | |
128 | 128 | $ns = 'app\\modules\\'.$moduleName; |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | $contents = [ |
135 | - $moduleFolder. DIRECTORY_SEPARATOR . 'README.md' => $this->renderReadme($folders, $moduleName, $ns), |
|
136 | - $moduleFolder. DIRECTORY_SEPARATOR . 'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns), |
|
137 | - $moduleFolder. DIRECTORY_SEPARATOR . 'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns), |
|
135 | + $moduleFolder.DIRECTORY_SEPARATOR.'README.md' => $this->renderReadme($folders, $moduleName, $ns), |
|
136 | + $moduleFolder.DIRECTORY_SEPARATOR.'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns), |
|
137 | + $moduleFolder.DIRECTORY_SEPARATOR.'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns), |
|
138 | 138 | ]; |
139 | 139 | |
140 | 140 | foreach ($contents as $fileName => $content) { |
@@ -39,6 +39,6 @@ |
||
39 | 39 | // get reflection |
40 | 40 | $class = new ReflectionClass($this); |
41 | 41 | // get path with alias |
42 | - return '@app/views/widgets/' . Inflector::camel2id($class->getShortName()); |
|
42 | + return '@app/views/widgets/'.Inflector::camel2id($class->getShortName()); |
|
43 | 43 | } |
44 | 44 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | @chdir(Yii::getAlias('@app')); |
48 | 48 | |
49 | - $this->output('The directory the health commands is applying to: ' . Yii::getAlias('@app')); |
|
49 | + $this->output('The directory the health commands is applying to: '.Yii::getAlias('@app')); |
|
50 | 50 | |
51 | 51 | foreach ($this->folders as $folder => $writable) { |
52 | 52 | $mode = ($writable) ? 0777 : 0775; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function parse($value, $sub) |
51 | 51 | { |
52 | - return Html::a(empty($sub) ? $value : $sub, 'tel:' . $this->ensureNumber($value)); |
|
52 | + return Html::a(empty($sub) ? $value : $sub, 'tel:'.$this->ensureNumber($value)); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | private function ensureNumber($number) |
@@ -18,5 +18,5 @@ |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | spl_autoload_register(['Yii', 'autoload'], true, true); |
21 | -Yii::$classMap = require(LUYA_YII_VENDOR . '/classes.php'); |
|
21 | +Yii::$classMap = require(LUYA_YII_VENDOR.'/classes.php'); |
|
22 | 22 | Yii::$container = new yii\di\Container(); |
@@ -36,15 +36,15 @@ |
||
36 | 36 | public function run($app) |
37 | 37 | { |
38 | 38 | foreach ($app->getApplicationModules() as $id => $module) { |
39 | - $folder = $module->basePath . DIRECTORY_SEPARATOR . 'commands'; |
|
39 | + $folder = $module->basePath.DIRECTORY_SEPARATOR.'commands'; |
|
40 | 40 | if (file_exists($folder) && is_dir($folder)) { |
41 | 41 | foreach (FileHelper::findFiles($folder) as $file) { |
42 | 42 | |
43 | - $module->controllerNamespace = $module->namespace . '\commands'; |
|
43 | + $module->controllerNamespace = $module->namespace.'\commands'; |
|
44 | 44 | |
45 | - $className = '\\'.$module->getNamespace().'\\commands\\' . pathinfo($file, PATHINFO_FILENAME); |
|
45 | + $className = '\\'.$module->getNamespace().'\\commands\\'.pathinfo($file, PATHINFO_FILENAME); |
|
46 | 46 | |
47 | - $command = str_replace('-controller', '', $module->id . '/' . Inflector::camel2id(pathinfo($file, PATHINFO_FILENAME))); |
|
47 | + $command = str_replace('-controller', '', $module->id.'/'.Inflector::camel2id(pathinfo($file, PATHINFO_FILENAME))); |
|
48 | 48 | |
49 | 49 | Yii::$app->controllerMap[$command] = ['class' => $className]; |
50 | 50 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | $migrationPath = $this->migrationPath[$module]; |
58 | 58 | |
59 | - $file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php'; |
|
59 | + $file = $migrationPath.DIRECTORY_SEPARATOR.$className.'.php'; |
|
60 | 60 | if ($this->confirm("Create new migration '$file'?")) { |
61 | 61 | $content = $this->generateMigrationSourceCode([ |
62 | 62 | 'name' => $name, |
@@ -213,14 +213,14 @@ |
||
213 | 213 | if (file_exists($this->_baseYiiFile)) { |
214 | 214 | defined('LUYA_YII_VENDOR') ?: define('LUYA_YII_VENDOR', dirname($this->_baseYiiFile)); |
215 | 215 | |
216 | - $baseYiiFolder = LUYA_YII_VENDOR . DIRECTORY_SEPARATOR; |
|
217 | - $luyaYiiFile = $this->getCoreBasePath() . DIRECTORY_SEPARATOR . 'Yii.php'; |
|
216 | + $baseYiiFolder = LUYA_YII_VENDOR.DIRECTORY_SEPARATOR; |
|
217 | + $luyaYiiFile = $this->getCoreBasePath().DIRECTORY_SEPARATOR.'Yii.php'; |
|
218 | 218 | |
219 | 219 | if (file_exists($luyaYiiFile)) { |
220 | - require_once($baseYiiFolder . 'BaseYii.php'); |
|
220 | + require_once($baseYiiFolder.'BaseYii.php'); |
|
221 | 221 | require_once($luyaYiiFile); |
222 | 222 | } else { |
223 | - require_once($baseYiiFolder . 'Yii.php'); |
|
223 | + require_once($baseYiiFolder.'Yii.php'); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | Yii::setAlias('@luya', $this->getCoreBasePath()); |