Completed
Pull Request — master (#1936)
by
unknown
02:00
created
core/theme/ThemeManager.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
core/console/commands/ThemeController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
core/theme/ThemeConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     
Please login to merge, or discard this patch.