Completed
Pull Request — master (#1997)
by Basil
02:41
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
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
             // if basePath is the theme file itself and existing process:
69 69
             $basePath = pathinfo($basePath, PATHINFO_DIRNAME);
70 70
         } else {
71
-            $themeFile = $dir . DIRECTORY_SEPARATOR . 'theme.json';
71
+            $themeFile = $dir.DIRECTORY_SEPARATOR.'theme.json';
72 72
             if (!file_exists($themeFile)) {
73
-                throw new InvalidConfigException('Theme config file missing at: ' . $themeFile);
73
+                throw new InvalidConfigException('Theme config file missing at: '.$themeFile);
74 74
             }
75 75
         }
76 76
         
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         
173 173
         if (file_exists(Yii::getAlias('@app/themes'))) {
174 174
             foreach (glob(Yii::getAlias('@app/themes/*')) as $dirPath) {
175
-                $themeDefinitions[] = "@app/themes/" . basename($dirPath);
175
+                $themeDefinitions[] = "@app/themes/".basename($dirPath);
176 176
             }
177 177
         }
178 178
         
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         
219 219
         $this->_themes[$basePath] = $themeConfig;
220 220
         
221
-        Yii::setAlias('@' . basename($basePath) . 'Theme', $basePath);
221
+        Yii::setAlias('@'.basename($basePath).'Theme', $basePath);
222 222
     }
223 223
     
224 224
     /**
Please login to merge, or discard this patch.