Completed
Pull Request — master (#1936)
by
unknown
01:57
created
core/theme/ThemeManager.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -146,6 +146,9 @@
 block discarded – undo
146 146
         return $themeDefinitions;
147 147
     }
148 148
     
149
+    /**
150
+     * @param string $basePath
151
+     */
149 152
     public function getThemeByBasePath($basePath)
150 153
     {
151 154
         $themes = $this->getThemes();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         if (strpos($basePath, '@') === 0) {
50 50
             $dir = Yii::getAlias($basePath);
51 51
         } elseif (strpos($basePath, '/') !== 0) {
52
-            $dir = $basePath = Yii::$app->basePath . DIRECTORY_SEPARATOR . $basePath;
52
+            $dir = $basePath = Yii::$app->basePath.DIRECTORY_SEPARATOR.$basePath;
53 53
         }
54 54
         
55 55
         if (!is_dir($dir) || !is_readable($dir)) {
56
-            throw new Exception('Theme directory not exists or readable: ' . $dir);
56
+            throw new Exception('Theme directory not exists or readable: '.$dir);
57 57
         }
58 58
         
59
-        $themeFile = $dir . '/theme.json';
59
+        $themeFile = $dir.'/theme.json';
60 60
         if (file_exists($themeFile)) {
61 61
             $config = Json::decode(file_get_contents($themeFile)) ?: [];
62 62
         } else {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         
153 153
         if (file_exists(Yii::getAlias('@app/themes'))) {
154 154
             foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) {
155
-                $themeDefinitions[] = "@app/themes/" . basename($dirPath);
155
+                $themeDefinitions[] = "@app/themes/".basename($dirPath);
156 156
             }
157 157
         }
158 158
         
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         
191 191
         $this->_themes[$themeConfig->getBasePath()] = $themeConfig;
192 192
         
193
-        Yii::setAlias('@' . basename($themeConfig->getBasePath()) . 'Theme', $themeConfig->getBasePath());
193
+        Yii::setAlias('@'.basename($themeConfig->getBasePath()).'Theme', $themeConfig->getBasePath());
194 194
     }
195 195
     
196 196
     /**
Please login to merge, or discard this patch.
core/theme/Theme.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         }
60 60
     
61 61
         $pos = strpos($viewPath, '/');
62
-        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views');
62
+        $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views');
63 63
         $this->pathMap[$rootPath] = $pathMap;
64 64
     
65 65
         $this->pathMap['@app/views'] = $pathMap;
@@ -79,17 +79,17 @@  discard block
 block discarded – undo
79 79
     
80 80
     public function getLayoutPath(): string
81 81
     {
82
-        return $this->viewPath . '/layouts';
82
+        return $this->viewPath.'/layouts';
83 83
     }
84 84
     
85 85
     public function getLayoutFile()
86 86
     {
87
-        return $this->layoutPath . '/' . $this->layout . '.php';
87
+        return $this->layoutPath.'/'.$this->layout.'.php';
88 88
     }
89 89
     
90 90
     public function getResourcePath()
91 91
     {
92
-        return $this->basePath . '/resources';
92
+        return $this->basePath.'/resources';
93 93
     }
94 94
     
95 95
     public function getConfig()
Please login to merge, or discard this patch.
core/traits/ErrorHandlerTrait.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @param string $message The message you want to send to the error api server.
69 69
      * @param string $file The you are currently send the message (use __FILE__)
70
-     * @param string $line The line you want to submit (use __LINE__)
70
+     * @param integer $line The line you want to submit (use __LINE__)
71 71
      * @return bool|null
72 72
      */
73 73
     public function transferMessage($message, $file = __FILE__, $line = __LINE__)
@@ -105,6 +105,7 @@  discard block
 block discarded – undo
105 105
     
106 106
     /**
107 107
      * @inheritdoc
108
+     * @param \Exception $exception
108 109
      */
109 110
     public function renderException($exception)
110 111
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
             $_file = $exception->getFile();
149 149
             $_line = $exception->getLine();
150 150
         } elseif (is_string($exception)) {
151
-            $_message = 'exception string: ' . $exception;
151
+            $_message = 'exception string: '.$exception;
152 152
         } elseif (is_array($exception)) {
153
-            $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: ' . print_r($exception, true);
153
+            $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: '.print_r($exception, true);
154 154
             $_file = isset($exception['file']) ? $exception['file'] : __FILE__;
155 155
             $_line = isset($exception['line']) ? $exception['line'] : __LINE__;
156 156
         }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         if (!empty($file)) {
217 217
             try {
218
-                $lineInArray = $line -1;
218
+                $lineInArray = $line - 1;
219 219
                 // load file from path
220 220
                 $fileInfo = file($file, FILE_IGNORE_NEW_LINES);
221 221
                 // load file if false from real path
Please login to merge, or discard this patch.