@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | if ($this->verbose) { |
| 42 | 42 | $message = $this->printableMessage($message); |
| 43 | - $this->output(!empty($section) ? $section . ': ' . $message : $message); |
|
| 43 | + $this->output(!empty($section) ? $section.': '.$message : $message); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $name = substr($name, 0, -(strlen($suffix))); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - return $name . $suffix; |
|
| 121 | + return $name.$suffix; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -89,10 +89,10 @@ |
||
| 89 | 89 | $(document).on('beforeSubmit', function (e) { |
| 90 | 90 | var buttonSelector = $(e.target).find(':submit'); |
| 91 | 91 | var formSelector = $(e.target); |
| 92 | - if (formSelector.find('div." . $this->_activeForm->errorCssClass . "').length === 0) { |
|
| 92 | + if (formSelector.find('div." . $this->_activeForm->errorCssClass."').length === 0) { |
|
| 93 | 93 | buttonSelector.attr('disabled', true); |
| 94 | - var newButtonLabel = '" . $this->pushed . "'; |
|
| 95 | - if (newButtonLabel) { buttonSelector.html('" . $this->pushed . "'); } |
|
| 94 | + var newButtonLabel = '" . $this->pushed."'; |
|
| 95 | + if (newButtonLabel) { buttonSelector.html('" . $this->pushed."'); } |
|
| 96 | 96 | } |
| 97 | 97 | return true;});"); |
| 98 | 98 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public static function search(array $array, $searchText, $sensitive = false, array $keys = []) |
| 159 | 159 | { |
| 160 | 160 | $function = $sensitive ? 'strpos' : 'stripos'; |
| 161 | - return array_filter($array, function ($item) use ($searchText, $function, $keys) { |
|
| 161 | + return array_filter($array, function($item) use ($searchText, $function, $keys) { |
|
| 162 | 162 | $response = false; |
| 163 | 163 | foreach ($item as $key => $value) { |
| 164 | 164 | if ($response) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $array = array_values($array); // align array keys |
| 207 | 207 | $columns = array_column($array, $column); |
| 208 | 208 | $key = array_search($search, $columns); |
| 209 | - return ($key !== false) ? $array[$key] : false; |
|
| 209 | + return ($key !== false) ? $array[$key] : false; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /** |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public static function searchColumns(array $array, $column, $search) |
| 240 | 240 | { |
| 241 | - $keys = array_filter($array, function ($var) use ($column, $search) { |
|
| 241 | + $keys = array_filter($array, function($var) use ($column, $search) { |
|
| 242 | 242 | return strcasecmp($search, $var[$column]) == 0 ? true : false; |
| 243 | 243 | }); |
| 244 | 244 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $array = array_combine($range, $range); |
| 279 | 279 | |
| 280 | 280 | if ($text) { |
| 281 | - array_walk($array, function (&$item, $key) use ($text) { |
|
| 281 | + array_walk($array, function(&$item, $key) use ($text) { |
|
| 282 | 282 | if (is_array($text)) { |
| 283 | 283 | list($singular, $plural) = $text; |
| 284 | 284 | if ($key == 1) { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public static function trailing($url, $slash = '/') |
| 36 | 36 | { |
| 37 | - return rtrim($url, $slash) . $slash; |
|
| 37 | + return rtrim($url, $slash).$slash; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | public static function ensureHttp($url, $https = false) |
| 88 | 88 | { |
| 89 | 89 | if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { |
| 90 | - $url = ($https ? "https://" : "http://") . $url; |
|
| 90 | + $url = ($https ? "https://" : "http://").$url; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $url; |
@@ -156,14 +156,14 @@ discard block |
||
| 156 | 156 | if (StringHelper::contains('?', $url)) { |
| 157 | 157 | // seperator already existing |
| 158 | 158 | if (StringHelper::endsWith($url, '&') || StringHelper::endsWith($url, '?')) { |
| 159 | - return $url . $append; |
|
| 159 | + return $url.$append; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | // add seperator |
| 163 | - return $url . '&' . $append; |
|
| 163 | + return $url.'&'.$append; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // use ? |
| 167 | - return $url . '?' . $append; |
|
| 167 | + return $url.'?'.$append; |
|
| 168 | 168 | } |
| 169 | 169 | } |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | var tts = $.textToSpeech({$config}); |
| 140 | 140 | var playButton = $('{$this->playButtonSelector}'); |
| 141 | 141 | var pauseButton = $('{$this->pauseButtonSelector}'); |
| 142 | - " . ($this->targetSelector ? "tts.setText($('{$this->targetSelector}').text());" : "") . " |
|
| 142 | + ".($this->targetSelector ? "tts.setText($('{$this->targetSelector}').text());" : "")." |
|
| 143 | 143 | var applyPlayClasses = function () { |
| 144 | 144 | playButton.addClass('{$this->playButtonActiveClass}'); |
| 145 | 145 | pauseButton.removeClass('{$this->pauseButtonActiveClass}'); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | if ($this->sourcePath === null) { |
| 31 | 31 | $class = new ReflectionClass($this); |
| 32 | - $this->sourcePath = dirname($class->getFileName()) . DIRECTORY_SEPARATOR . $this->defaultSourcePathFolder . DIRECTORY_SEPARATOR . Inflector::camel2id($class->getShortName()); |
|
| 32 | + $this->sourcePath = dirname($class->getFileName()).DIRECTORY_SEPARATOR.$this->defaultSourcePathFolder.DIRECTORY_SEPARATOR.Inflector::camel2id($class->getShortName()); |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -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 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | foreach ($queue as $pos => $object) { |
| 187 | 187 | $this->verbosePrint("Run importer object '{$object->className()}' on position '{$pos}'.", __METHOD__); |
| 188 | - $this->verbosePrint('Module context id: ' . $object->module->id); |
|
| 188 | + $this->verbosePrint('Module context id: '.$object->module->id); |
|
| 189 | 189 | $object->run(); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | Yii::$app->db->createCommand()->update('admin_user', ['force_reload' => 1])->execute(); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - $this->output('LUYA import command (based on LUYA ' . Boot::VERSION . ')'); |
|
| 198 | + $this->output('LUYA import command (based on LUYA '.Boot::VERSION.')'); |
|
| 199 | 199 | |
| 200 | 200 | foreach ($this->getLog() as $section => $value) { |
| 201 | - $this->outputInfo(PHP_EOL . $section . ":"); |
|
| 201 | + $this->outputInfo(PHP_EOL.$section.":"); |
|
| 202 | 202 | $this->logValueToTable($value); |
| 203 | 203 | } |
| 204 | 204 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $dir = $basePath; |
| 56 | 56 | } else { |
| 57 | 57 | // relative path |
| 58 | - throw new InvalidConfigException('Theme base path have to be absolute or alias: ' . $basePath); |
|
| 58 | + throw new InvalidConfigException('Theme base path have to be absolute or alias: '.$basePath); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // $basePath is an absolute path = /VENDOR/NAME/theme.json |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | $basePath = pathinfo($basePath, PATHINFO_DIRNAME); |
| 66 | 66 | } else { |
| 67 | 67 | if (!is_dir($dir) || !is_readable($dir)) { |
| 68 | - throw new Exception('Theme directory not exists or readable: ' . $dir); |
|
| 68 | + throw new Exception('Theme directory not exists or readable: '.$dir); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - $themeFile = $dir . DIRECTORY_SEPARATOR . 'theme.json'; |
|
| 71 | + $themeFile = $dir.DIRECTORY_SEPARATOR.'theme.json'; |
|
| 72 | 72 | if (!file_exists($themeFile)) { |
| 73 | - throw new InvalidConfigException('Theme config file missing at: ' . $themeFile); |
|
| 73 | + throw new InvalidConfigException('Theme config file missing at: '.$themeFile); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | if (file_exists(Yii::getAlias('@app/themes'))) { |
| 174 | 174 | foreach (glob(Yii::getAlias('@app/themes/*')) as $dirPath) { |
| 175 | - $themeDefinitions[] = "@app/themes/" . basename($dirPath); |
|
| 175 | + $themeDefinitions[] = "@app/themes/".basename($dirPath); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | $this->_themes[$basePath] = $themeConfig; |
| 228 | 228 | |
| 229 | - Yii::setAlias('@' . basename($basePath) . 'Theme', $basePath); |
|
| 229 | + Yii::setAlias('@'.basename($basePath).'Theme', $basePath); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -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 . '/themes/' . $themeName; |
|
| 62 | + $basePath = $themeLocation.'/themes/'.$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,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/'. $themeName .'-asset/style.css' => '', |
|
| 91 | - $themeFolder. DIRECTORY_SEPARATOR . 'views/layouts/theme.php' => $this->renderLayout($themeName), |
|
| 92 | - $themeFolder. DIRECTORY_SEPARATOR . 'views/cmslayouts/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/'.$themeName.'-asset/style.css' => '', |
|
| 91 | + $themeFolder.DIRECTORY_SEPARATOR.'views/layouts/theme.php' => $this->renderLayout($themeName), |
|
| 92 | + $themeFolder.DIRECTORY_SEPARATOR.'views/cmslayouts/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 | /** |