@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($throwException) { |
51 | - throw new Exception("The given object must be an instance of: " . implode(",", $haystack)); |
|
51 | + throw new Exception("The given object must be an instance of: ".implode(",", $haystack)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return false; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | }; |
220 | 220 | |
221 | - $staticPath = $module::staticBasePath() . DIRECTORY_SEPARATOR . 'controllers'; |
|
221 | + $staticPath = $module::staticBasePath().DIRECTORY_SEPARATOR.'controllers'; |
|
222 | 222 | if (is_dir($staticPath)) { |
223 | 223 | foreach (FileHelper::findFiles($staticPath) as $file) { |
224 | 224 | $files[self::fileToName($staticPath, $file)] = $file; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | { |
217 | 217 | $this->theme = Yii::$app->themeManager->getActiveTheme(); |
218 | 218 | |
219 | - if ($this->theme){ |
|
219 | + if ($this->theme) { |
|
220 | 220 | $this->layout = $this->theme->layout; |
221 | 221 | |
222 | 222 | if ($this->useAppLayoutPath) { |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | */ |
330 | 330 | public function getControllerPath() |
331 | 331 | { |
332 | - return Yii::getAlias('@' . str_replace('\\', '/', $this->controllerNamespace), false); |
|
332 | + return Yii::getAlias('@'.str_replace('\\', '/', $this->controllerNamespace), false); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | // STATIC METHODS |
@@ -49,14 +49,14 @@ discard block |
||
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 |
||
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 |
||
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 | /** |
@@ -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 |
@@ -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 | if ($newThemeLocation[0] !== $themeLocation) { |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - $basePath = $themeLocation . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName; |
|
61 | + $basePath = $themeLocation.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName; |
|
62 | 62 | $themeFolder = Yii::getAlias($basePath); |
63 | 63 | |
64 | 64 | if (file_exists($themeFolder)) { |
65 | - return $this->outputError("The folder " . $themeFolder . " exists already."); |
|
65 | + return $this->outputError("The folder ".$themeFolder." exists already."); |
|
66 | 66 | } |
67 | 67 | |
68 | - $this->outputInfo("Theme path alias: " . $basePath); |
|
69 | - $this->outputInfo("Theme real path: " . $themeFolder); |
|
68 | + $this->outputInfo("Theme path alias: ".$basePath); |
|
69 | + $this->outputInfo("Theme real path: ".$themeFolder); |
|
70 | 70 | if (!$this->confirm("Do you want continue?")) { |
71 | 71 | return $this->outputError('Abort by user.'); |
72 | 72 | } |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | ]; |
81 | 81 | |
82 | 82 | foreach ($folders as $folder) { |
83 | - FileHelper::createDirectory($themeFolder . DIRECTORY_SEPARATOR . $folder); |
|
83 | + FileHelper::createDirectory($themeFolder.DIRECTORY_SEPARATOR.$folder); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $contents = [ |
87 | - $themeFolder. DIRECTORY_SEPARATOR . 'theme.json' => $this->renderJson($basePath, $themeName), |
|
87 | + $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName), |
|
88 | 88 | ]; |
89 | 89 | |
90 | 90 | foreach ($contents as $fileName => $content) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $themeConfig->parentTheme = $this->prompt("Enter the base path (e.g. `@app/themes/blank`) of the parent theme:", |
111 | 111 | [ |
112 | 112 | 'default' => '@app/themes/blank', |
113 | - 'validator' => function ($input, &$error) { |
|
113 | + 'validator' => function($input, &$error) { |
|
114 | 114 | if (preg_match('/^[a-z]+$/', $input) === false) { |
115 | 115 | $error = 'The theme name must be only letter chars!'; |
116 | 116 | return false; |
@@ -97,6 +97,6 @@ |
||
97 | 97 | |
98 | 98 | public function getViewPath() |
99 | 99 | { |
100 | - return $this->getBasePath() . '/views'; |
|
100 | + return $this->getBasePath().'/views'; |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | \ No newline at end of file |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | $pos = strpos($viewPath, '/'); |
67 | - $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos) . '/views'); |
|
67 | + $rootPath = $pos === false ? $viewPath : (substr($viewPath, 0, $pos).'/views'); |
|
68 | 68 | $this->pathMap[$rootPath] = $pathMap; |
69 | 69 | |
70 | 70 | $this->pathMap['@app/views'] = $pathMap; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | public function getLayoutPath() |
86 | 86 | { |
87 | - return $this->viewPath . '/' . self::LAYOUTS_PATH; |
|
87 | + return $this->viewPath.'/'.self::LAYOUTS_PATH; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | public function getConfig() |