@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | $dir = Yii::getAlias($themeDefinition); |
105 | 105 | |
106 | 106 | if (!is_dir($dir) || is_readable($dir)) { |
107 | - throw new Exception('Theme directory not exists or readable: ' . $dir); |
|
107 | + throw new Exception('Theme directory not exists or readable: '.$dir); |
|
108 | 108 | } |
109 | 109 | |
110 | - $themeFile = $dir . '/theme.json'; |
|
110 | + $themeFile = $dir.'/theme.json'; |
|
111 | 111 | if (file_exists($themeFile)) { |
112 | 112 | $themeConfig = new ThemeConfig($themeDefinition); |
113 | 113 | $this->_themes[$themeDefinition] = $themeConfig; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $themeDefinitions = []; |
128 | 128 | |
129 | 129 | foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) { |
130 | - $themeDefinitions = array_merge($themeDefinitions, "@app/themes/" , basename($dirPath)); |
|
130 | + $themeDefinitions = array_merge($themeDefinitions, "@app/themes/", basename($dirPath)); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | foreach (Yii::$app->getPackageInstaller()->getConfigs() as $config) { |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace luya\theme; |
4 | 4 | |
5 | 5 | use luya\base\PackageConfig; |
6 | -use luya\helpers\Json; |
|
7 | 6 | use Yii; |
8 | 7 | use luya\Exception; |
9 | 8 | use yii\base\InvalidConfigException; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $themeConfig->parentTheme = $this->prompt("Enter the base path (e.g. `@app/themes/blank`) of the parent theme:", |
49 | 49 | [ |
50 | 50 | 'default' => '@app/themes/blank', |
51 | - 'validator' => function ($input, &$error) { |
|
51 | + 'validator' => function($input, &$error) { |
|
52 | 52 | if (preg_match('/^[a-z]+$/', $input) === false) { |
53 | 53 | $error = 'The theme name must be only letter chars!'; |
54 | 54 | return false; |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - $basePath = '@app' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName; |
|
88 | + $basePath = '@app'.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName; |
|
89 | 89 | |
90 | - $appModulesFolder = Yii::$app->basePath . DIRECTORY_SEPARATOR . 'themes'; |
|
91 | - $themeFolder = $appModulesFolder . DIRECTORY_SEPARATOR . $themeName; |
|
90 | + $appModulesFolder = Yii::$app->basePath.DIRECTORY_SEPARATOR.'themes'; |
|
91 | + $themeFolder = $appModulesFolder.DIRECTORY_SEPARATOR.$themeName; |
|
92 | 92 | |
93 | 93 | if (file_exists($themeFolder)) { |
94 | - return $this->outputError("The folder " . $themeFolder . " exists already."); |
|
94 | + return $this->outputError("The folder ".$themeFolder." exists already."); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $folders = [ |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | ]; |
104 | 104 | |
105 | 105 | foreach ($folders as $folder) { |
106 | - FileHelper::createDirectory($themeFolder . DIRECTORY_SEPARATOR . $folder); |
|
106 | + FileHelper::createDirectory($themeFolder.DIRECTORY_SEPARATOR.$folder); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | $contents = [ |
110 | - $themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName), |
|
110 | + $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName), |
|
111 | 111 | ]; |
112 | 112 | |
113 | 113 | foreach ($contents as $fileName => $content) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $config = []; |
38 | 38 | |
39 | - $themeFile = Yii::getAlias($basePath . '/theme.json'); |
|
39 | + $themeFile = Yii::getAlias($basePath.'/theme.json'); |
|
40 | 40 | if (file_exists($themeFile)) { |
41 | 41 | $config = Json::decode(file_get_contents($themeFile)) ?: []; |
42 | 42 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function getViewPath(): string |
94 | 94 | { |
95 | - return $this->getBasePath() . '/views'; |
|
95 | + return $this->getBasePath().'/views'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 |