@@ -146,6 +146,9 @@ |
||
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(); |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | $dir = Yii::getAlias($basePath); |
49 | 49 | |
50 | 50 | if (!is_dir($dir) || !is_readable($dir)) { |
51 | - throw new Exception('Theme directory not exists or readable: ' . $dir); |
|
51 | + throw new Exception('Theme directory not exists or readable: '.$dir); |
|
52 | 52 | } |
53 | 53 | |
54 | - $themeFile = $dir . '/theme.json'; |
|
54 | + $themeFile = $dir.'/theme.json'; |
|
55 | 55 | if (file_exists($themeFile)) { |
56 | 56 | $config = Json::decode(file_get_contents($themeFile)) ?: []; |
57 | 57 | } else { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | if (file_exists(Yii::getAlias('@app/themes'))) { |
136 | 136 | foreach (scandir(Yii::getAlias('@app/themes')) as $dirPath) { |
137 | - $themeDefinitions[] = "@app/themes/" . basename($dirPath); |
|
137 | + $themeDefinitions[] = "@app/themes/".basename($dirPath); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | $this->_themes[$themeConfig->getBasePath()] = $themeConfig; |
174 | 174 | |
175 | - Yii::setAlias('@' . basename($themeConfig->getBasePath()) . 'Theme', $themeConfig->getBasePath()); |
|
175 | + Yii::setAlias('@'.basename($themeConfig->getBasePath()).'Theme', $themeConfig->getBasePath()); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -59,7 +59,7 @@ discard block |
||
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 |
||
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() |
@@ -67,7 +67,7 @@ discard block |
||
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 |
||
105 | 105 | |
106 | 106 | /** |
107 | 107 | * @inheritdoc |
108 | + * @param \Exception $exception |
|
108 | 109 | */ |
109 | 110 | public function renderException($exception) |
110 | 111 | { |
@@ -148,9 +148,9 @@ discard block |
||
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 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $postContext = []; |
215 | 215 | |
216 | 216 | try { |
217 | - $lineInArray = $line -1; |
|
217 | + $lineInArray = $line - 1; |
|
218 | 218 | // load file from path |
219 | 219 | $fileInfo = file($file, FILE_IGNORE_NEW_LINES); |
220 | 220 | // load file if false from real path |