Completed
Pull Request — master (#1997)
by Basil
02:34 queued 11s
created
core/theme/ThemeManager.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use luya\base\PackageConfig;
6 6
 use luya\Exception;
7
-use luya\helpers\FileHelper;
8 7
 use luya\helpers\Json;
9 8
 use Yii;
10 9
 use yii\base\InvalidArgumentException;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
         if (strpos($basePath, '@') === 0) {
54 54
             $dir = Yii::getAlias($basePath);
55 55
         } elseif (strpos($basePath, '/') !== 0) {
56
-            $dir = $basePath = Yii::$app->basePath . DIRECTORY_SEPARATOR . $basePath;
56
+            $dir = $basePath = Yii::$app->basePath.DIRECTORY_SEPARATOR.$basePath;
57 57
         } else {
58 58
             $dir = $basePath;
59 59
         }
60 60
         
61 61
         if (!is_dir($dir) || !is_readable($dir)) {
62
-            throw new Exception('Theme directory not exists or readable: ' . $dir);
62
+            throw new Exception('Theme directory not exists or readable: '.$dir);
63 63
         }
64 64
         
65 65
         // $basePath is an absolute path = /VENDOR/NAME/theme.json
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
             // if basePath is the theme file itself and existing process:
68 68
             $themeFile = $basePath;
69 69
         } else {
70
-            $themeFile = $dir . DIRECTORY_SEPARATOR . 'theme.json';
70
+            $themeFile = $dir.DIRECTORY_SEPARATOR.'theme.json';
71 71
             if (!file_exists($themeFile)) {
72
-                throw new InvalidConfigException('Theme config file missing at: ' . $themeFile);
72
+                throw new InvalidConfigException('Theme config file missing at: '.$themeFile);
73 73
             }
74 74
         }
75 75
         
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         
172 172
         if (file_exists(Yii::getAlias('@app/themes'))) {
173 173
             foreach (glob(Yii::getAlias('@app/themes/*')) as $dirPath) {
174
-                $themeDefinitions[] = "@app/themes/" . basename($dirPath);
174
+                $themeDefinitions[] = "@app/themes/".basename($dirPath);
175 175
             }
176 176
         }
177 177
         
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         
218 218
         $this->_themes[$basePath] = $themeConfig;
219 219
         
220
-        Yii::setAlias('@' . basename($basePath) . 'Theme', $basePath);
220
+        Yii::setAlias('@'.basename($basePath).'Theme', $basePath);
221 221
     }
222 222
     
223 223
     /**
Please login to merge, or discard this patch.