@@ -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 | } |
@@ -215,7 +215,7 @@ discard block |
||
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 |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $output = null; |
141 | 141 | foreach ($input as $row) { |
142 | - $output.= self::generateRow($row, $delimiter, '"'); |
|
142 | + $output .= self::generateRow($row, $delimiter, '"'); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $output; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | protected static function generateRow(array $row, $delimiter, $enclose) |
158 | 158 | { |
159 | - array_walk($row, function (&$item) use ($enclose) { |
|
159 | + array_walk($row, function(&$item) use ($enclose) { |
|
160 | 160 | if (is_bool($item)) { |
161 | 161 | $item = (int) $item; |
162 | 162 | } elseif (is_null($item)) { |
@@ -171,6 +171,6 @@ discard block |
||
171 | 171 | ], $item).$enclose; |
172 | 172 | }); |
173 | 173 | |
174 | - return implode($delimiter, $row) . PHP_EOL; |
|
174 | + return implode($delimiter, $row).PHP_EOL; |
|
175 | 175 | } |
176 | 176 | } |
@@ -140,6 +140,6 @@ |
||
140 | 140 | */ |
141 | 141 | public function getViewPath() |
142 | 142 | { |
143 | - return $this->getBasePath() . '/views'; |
|
143 | + return $this->getBasePath().'/views'; |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | \ No newline at end of file |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function getLayoutPath() |
209 | 209 | { |
210 | - if (Yii::$app->themeManager->hasActiveTheme && $this->useAppLayoutPath){ |
|
210 | + if (Yii::$app->themeManager->hasActiveTheme && $this->useAppLayoutPath) { |
|
211 | 211 | $this->setLayoutPath(Yii::$app->themeManager->activeTheme->layoutPath); |
212 | 212 | } elseif ($this->useAppLayoutPath) { |
213 | 213 | $this->setLayoutPath('@app/views/'.$this->id.'/layouts'); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function getControllerPath() |
315 | 315 | { |
316 | - return Yii::getAlias('@' . str_replace('\\', '/', $this->controllerNamespace), false); |
|
316 | + return Yii::getAlias('@'.str_replace('\\', '/', $this->controllerNamespace), false); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | // STATIC METHODS |
@@ -53,18 +53,18 @@ discard block |
||
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 | - $themeFile = $dir . '/theme.json'; |
|
65 | + $themeFile = $dir.'/theme.json'; |
|
66 | 66 | if (!file_exists($themeFile)) { |
67 | - throw new InvalidConfigException('Theme config file missing at: ' . $themeFile); |
|
67 | + throw new InvalidConfigException('Theme config file missing at: '.$themeFile); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $config = Json::decode(file_get_contents($themeFile)) ?: []; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | if (file_exists(Yii::getAlias('@app/themes'))) { |
161 | 161 | foreach (glob(Yii::getAlias('@app/themes/*')) as $dirPath) { |
162 | - $themeDefinitions[] = "@app/themes/" . basename($dirPath); |
|
162 | + $themeDefinitions[] = "@app/themes/".basename($dirPath); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | $this->_themes[$basePath] = $themeConfig; |
207 | 207 | |
208 | - Yii::setAlias('@' . basename($basePath) . 'Theme', $basePath); |
|
208 | + Yii::setAlias('@'.basename($basePath).'Theme', $basePath); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | $pos = strpos($viewPath, '/'); |
77 | - $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views'); |
|
77 | + $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views'); |
|
78 | 78 | $this->pathMap[$rootPath] = $pathMap; |
79 | 79 | |
80 | 80 | $this->pathMap['@app/views'] = $pathMap; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getLayoutPath() |
111 | 111 | { |
112 | - return $this->viewPath . '/' . self::LAYOUTS_PATH; |
|
112 | + return $this->viewPath.'/'.self::LAYOUTS_PATH; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $availableModules = implode(', ', array_column(Yii::$app->getFrontendModules(), 'id')); |
49 | 49 | $themeLocation = $this->prompt("Enter the theme location where to generate (as path alias e.g. app, $availableModules):", ['default' => 'app']); |
50 | - $themeLocation = '@' . ltrim($themeLocation, '@'); |
|
50 | + $themeLocation = '@'.ltrim($themeLocation, '@'); |
|
51 | 51 | |
52 | 52 | preg_match("#^@[A-z]+#", $themeLocation, $newThemeLocation); |
53 | 53 | |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | - $basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName; |
|
62 | + $basePath = $themeLocation.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName; |
|
63 | 63 | $themeFolder = Yii::getAlias($basePath); |
64 | 64 | |
65 | 65 | if (file_exists($themeFolder)) { |
66 | - return $this->outputError("The folder " . $themeFolder . " exists already."); |
|
66 | + return $this->outputError("The folder ".$themeFolder." exists already."); |
|
67 | 67 | } |
68 | 68 | |
69 | - $this->outputInfo("Theme path alias: " . $basePath); |
|
70 | - $this->outputInfo("Theme real path: " . $themeFolder); |
|
69 | + $this->outputInfo("Theme path alias: ".$basePath); |
|
70 | + $this->outputInfo("Theme real path: ".$themeFolder); |
|
71 | 71 | if (!$this->confirm("Do you want continue?")) { |
72 | 72 | return $this->outputError('Abort by user.'); |
73 | 73 | } |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | ]; |
82 | 82 | |
83 | 83 | foreach ($folders as $folder) { |
84 | - FileHelper::createDirectory($themeFolder . DIRECTORY_SEPARATOR . $folder); |
|
84 | + FileHelper::createDirectory($themeFolder.DIRECTORY_SEPARATOR.$folder); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $contents = [ |
88 | - $themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName), |
|
88 | + $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName), |
|
89 | 89 | ]; |
90 | 90 | |
91 | 91 | foreach ($contents as $fileName => $content) { |