@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->_mailer->isSMTP(); |
| 143 | 143 | $this->_mailer->SMTPSecure = $this->smtpSecure; |
| 144 | 144 | $this->_mailer->Host = (string) $this->host; |
| 145 | - $this->_mailer->SMTPAuth= $this->smtpAuth; |
|
| 145 | + $this->_mailer->SMTPAuth = $this->smtpAuth; |
|
| 146 | 146 | $this->_mailer->Username = $this->username; |
| 147 | 147 | $this->_mailer->Password = $this->password; |
| 148 | 148 | $this->_mailer->Port = $this->port; |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | return true; |
| 503 | 503 | } else { |
| 504 | 504 | $data = [$this->host, $this->port, $this->smtpSecure, $this->username]; |
| 505 | - throw new Exception('Authentication failed ('.implode(',', $data).'): '.$smtp->getLastReply() . PHP_EOL . print_r($smtp->getError(), true)); |
|
| 505 | + throw new Exception('Authentication failed ('.implode(',', $data).'): '.$smtp->getLastReply().PHP_EOL.print_r($smtp->getError(), true)); |
|
| 506 | 506 | } |
| 507 | 507 | } else { |
| 508 | 508 | throw new Exception('HELO failed: '.$smtp->getLastReply()); |
@@ -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 | } |