@@ -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; |
|
63 | - $themeFolder = Yii::getAlias($themeLocation) . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $themeName; |
|
62 | + $basePath = $themeLocation.DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName; |
|
63 | + $themeFolder = Yii::getAlias($themeLocation).DIRECTORY_SEPARATOR.'themes'.DIRECTORY_SEPARATOR.$themeName; |
|
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,15 +81,15 @@ 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), |
|
89 | - $themeFolder. DIRECTORY_SEPARATOR . ucfirst($themeName) . 'Asset.php' => $this->renderAssetClass($themeName), |
|
90 | - $themeFolder. DIRECTORY_SEPARATOR . 'resources'.DIRECTORY_SEPARATOR. $themeName .'.css' => '', |
|
91 | - $themeFolder. DIRECTORY_SEPARATOR . 'views'.DIRECTORY_SEPARATOR.'layouts'.DIRECTORY_SEPARATOR.'theme.php' => $this->renderLayout($themeName), |
|
92 | - $themeFolder. DIRECTORY_SEPARATOR . 'views'.DIRECTORY_SEPARATOR.'cmslayouts'.DIRECTORY_SEPARATOR.'theme.php' => $this->renderCmsLayout($themeName), |
|
88 | + $themeFolder.DIRECTORY_SEPARATOR.'theme.json' => $this->renderJson($basePath, $themeName), |
|
89 | + $themeFolder.DIRECTORY_SEPARATOR.ucfirst($themeName).'Asset.php' => $this->renderAssetClass($themeName), |
|
90 | + $themeFolder.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.$themeName.'.css' => '', |
|
91 | + $themeFolder.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'layouts'.DIRECTORY_SEPARATOR.'theme.php' => $this->renderLayout($themeName), |
|
92 | + $themeFolder.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'cmslayouts'.DIRECTORY_SEPARATOR.'theme.php' => $this->renderCmsLayout($themeName), |
|
93 | 93 | ]; |
94 | 94 | |
95 | 95 | foreach ($contents as $fileName => $content) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function renderAssetClass($themeName) |
152 | 152 | { |
153 | - $className = ucfirst($themeName) . 'Asset'; |
|
153 | + $className = ucfirst($themeName).'Asset'; |
|
154 | 154 | return "<?php |
155 | 155 | namespace app\\themes\\{$themeName}; |
156 | 156 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | private function renderLayout($themeName) |
173 | 173 | { |
174 | - $className = ucfirst($themeName) . 'Asset'; |
|
174 | + $className = ucfirst($themeName).'Asset'; |
|
175 | 175 | |
176 | 176 | return '<?php |
177 | 177 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $length = strlen($composition); |
124 | 124 | $route = $parsedRequest[0]; |
125 | 125 | |
126 | - if (substr($route, 0, $length+1) == $composition.'/') { |
|
126 | + if (substr($route, 0, $length + 1) == $composition.'/') { |
|
127 | 127 | $parsedRequest[0] = substr($parsedRequest[0], $length); |
128 | 128 | } |
129 | 129 | |
@@ -333,10 +333,10 @@ discard block |
||
333 | 333 | $params = (array) $params; |
334 | 334 | $url = $this->internalCreateUrl($params, $composition); |
335 | 335 | if (strpos($url, '://') === false) { |
336 | - $url = $this->getHostInfo() . $url; |
|
336 | + $url = $this->getHostInfo().$url; |
|
337 | 337 | } |
338 | 338 | if (is_string($scheme) && ($pos = strpos($url, '://')) !== false) { |
339 | - $url = $scheme . substr($url, $pos); |
|
339 | + $url = $scheme.substr($url, $pos); |
|
340 | 340 | } |
341 | 341 | return $url; |
342 | 342 | } |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | protected function timeToIso8601Duration($time) |
59 | 59 | { |
60 | 60 | $units = [ |
61 | - "Y" => 365*24*3600, |
|
62 | - "D" => 24*3600, |
|
61 | + "Y" => 365 * 24 * 3600, |
|
62 | + "D" => 24 * 3600, |
|
63 | 63 | "H" => 3600, |
64 | 64 | "M" => 60, |
65 | 65 | "S" => 1, |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $str .= "T"; |
78 | 78 | $istime = true; |
79 | 79 | } |
80 | - $str .= strval($unit) . $unitName; |
|
80 | + $str .= strval($unit).$unitName; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $this->_dirs[$folderName][] = [ |
77 | 77 | 'ns' => $ns, |
78 | 78 | 'module' => $module, |
79 | - 'folderPath' => rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, |
|
79 | + 'folderPath' => rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR, |
|
80 | 80 | 'files' => $this->scanDirectoryFiles($path, $ns, $module), |
81 | 81 | ]; |
82 | 82 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | foreach ($queue as $pos => $object) { |
190 | 190 | $this->verbosePrint("Run importer object '{$object->className()}' on position '{$pos}'.", __METHOD__); |
191 | - $this->verbosePrint('Module context id: ' . $object->module->id); |
|
191 | + $this->verbosePrint('Module context id: '.$object->module->id); |
|
192 | 192 | $object->run(); |
193 | 193 | } |
194 | 194 | |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | Yii::$app->db->createCommand()->update('admin_user', ['force_reload' => 1])->execute(); |
199 | 199 | } |
200 | 200 | |
201 | - $this->output('LUYA import command (based on LUYA ' . Boot::VERSION . ')'); |
|
201 | + $this->output('LUYA import command (based on LUYA '.Boot::VERSION.')'); |
|
202 | 202 | |
203 | 203 | foreach ($this->getLog() as $section => $value) { |
204 | - $this->outputInfo(PHP_EOL . $section . ":"); |
|
204 | + $this->outputInfo(PHP_EOL.$section.":"); |
|
205 | 205 | $this->logValueToTable($value); |
206 | 206 | } |
207 | 207 |
@@ -139,7 +139,7 @@ |
||
139 | 139 | { |
140 | 140 | if (!is_object($this->tags[$tag])) { |
141 | 141 | $this->tags[$tag] = Yii::createObject($this->tags[$tag]); |
142 | - Yii::debug('tag parser object generated for:'. $tag, self::class); |
|
142 | + Yii::debug('tag parser object generated for:'.$tag, self::class); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | $_file = $exception->getFile(); |
177 | 177 | $_line = $exception->getLine(); |
178 | 178 | } elseif (is_string($exception)) { |
179 | - $_message = 'exception string: ' . $exception; |
|
179 | + $_message = 'exception string: '.$exception; |
|
180 | 180 | } elseif (is_array($exception)) { |
181 | - $_message = $exception['message'] ?? 'exception array dump: ' . print_r($exception, true); |
|
181 | + $_message = $exception['message'] ?? 'exception array dump: '.print_r($exception, true); |
|
182 | 182 | $_file = $exception['file'] ?? __FILE__; |
183 | 183 | $_line = $exception['line'] ?? __LINE__; |
184 | 184 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | if (!empty($file)) { |
262 | 262 | try { |
263 | - $lineInArray = $line -1; |
|
263 | + $lineInArray = $line - 1; |
|
264 | 264 | // load file from path |
265 | 265 | $fileInfo = file($file, FILE_IGNORE_NEW_LINES); |
266 | 266 | // load file if false from real path |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | 'class' => $item['class'] ?? null, |
301 | 301 | // currently arguments wont be transmited due to large amount of informations based on base object |
302 | 302 | //'args' => isset($item['args']) ? ArrayHelper::coverSensitiveValues($item['args'], $this->sensitiveKeys) : [], |
303 | - ], function ($value) { |
|
303 | + ], function($value) { |
|
304 | 304 | return !empty($value); |
305 | 305 | }); |
306 | 306 | } |
@@ -6,13 +6,13 @@ |
||
6 | 6 | use Rector\Config\RectorConfig; |
7 | 7 | use Rector\Set\ValueObject\LevelSetList; |
8 | 8 | |
9 | -return static function (RectorConfig $rectorConfig): void { |
|
9 | +return static function(RectorConfig $rectorConfig): void { |
|
10 | 10 | $rectorConfig->paths([ |
11 | - __DIR__ . '/core' |
|
11 | + __DIR__.'/core' |
|
12 | 12 | ]); |
13 | 13 | |
14 | 14 | $rectorConfig->skip([ |
15 | - __DIR__ . '/core/vendor', |
|
15 | + __DIR__.'/core/vendor', |
|
16 | 16 | ]); |
17 | 17 | |
18 | 18 | // register a single rule |