@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | Yii::setAlias('@root', $this->getRootDir()); |
| 87 | 87 | $config = $this->takeConfig()->rawItem('package'); |
| 88 | 88 | $alias = isset($config['namespace']) ? strtr($config['namespace'], '\\', '/') : ''; |
| 89 | - if ($alias && !Yii::getAlias('@' . $alias, false)) { |
|
| 90 | - $srcdir = Yii::getAlias('@root/' . ($config['src'] ?: 'src')); |
|
| 89 | + if ($alias && !Yii::getAlias('@'.$alias, false)) { |
|
| 90 | + $srcdir = Yii::getAlias('@root/'.($config['src'] ?: 'src')); |
|
| 91 | 91 | Yii::setAlias($alias, $srcdir); |
| 92 | 92 | } |
| 93 | 93 | $aliases = $this->takeConfig()->rawItem('aliases'); |
@@ -220,6 +220,6 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | public function buildRootPath($subpath) |
| 222 | 222 | { |
| 223 | - return $this->getRootDir() . DIRECTORY_SEPARATOR . $subpath; |
|
| 223 | + return $this->getRootDir().DIRECTORY_SEPARATOR.$subpath; |
|
| 224 | 224 | } |
| 225 | 225 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | foreach ($this->getItems() as $id => $config) { |
| 41 | 41 | $defaults = [ |
| 42 | 42 | 'class' => isset($config['template']) || isset($config['copy']) ? 'template' : 'directory', |
| 43 | - 'file' => $this->path . '/' . $id, |
|
| 43 | + 'file' => $this->path.'/'.$id, |
|
| 44 | 44 | ]; |
| 45 | 45 | if ($this->recursive) { |
| 46 | 46 | $defaults['recursive'] = $this->recursive; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function mkdir($path) |
| 59 | 59 | { |
| 60 | - Yii::warning('mkdir ' . $path, 'dir'); |
|
| 60 | + Yii::warning('mkdir '.$path, 'dir'); |
|
| 61 | 61 | mkdir($path); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $cur = (int) date('Y'); |
| 43 | 43 | $old = (int) $this->year; |
| 44 | 44 | |
| 45 | - return ($old && $old < $cur ? $this->year . '-' : '') . $cur; |
|
| 45 | + return ($old && $old < $cur ? $this->year.'-' : '').$cur; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function getYear() |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function getIssues() |
| 59 | 59 | { |
| 60 | - return $this->getItem('issues') ?: ($this->source . '/issues'); |
|
| 60 | + return $this->getItem('issues') ?: ($this->source.'/issues'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | public function getWiki() |
| 64 | 64 | { |
| 65 | - return $this->getItem('wiki') ?: ($this->source . '/wiki'); |
|
| 65 | + return $this->getItem('wiki') ?: ($this->source.'/wiki'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function getKeywords() |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public function getFullName() |
| 74 | 74 | { |
| 75 | - return $this->getItem('fullName') ?: ($this->takeVendor()->name . '/' . $this->name); |
|
| 75 | + return $this->getItem('fullName') ?: ($this->takeVendor()->name.'/'.$this->name); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public function getSource() |
| 79 | 79 | { |
| 80 | - return $this->getItem('source') ?: ('https://github.com/' . $this->takeGoal('github')->full_name); |
|
| 80 | + return $this->getItem('source') ?: ('https://github.com/'.$this->takeGoal('github')->full_name); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function getVersion() |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public static function defaultNamespace($vendor, $package) |
| 94 | 94 | { |
| 95 | - return preg_replace('/[^a-zA-Z0-9\\\\]+/', '', $vendor . strtr("-$package", '-', '\\')); |
|
| 95 | + return preg_replace('/[^a-zA-Z0-9\\\\]+/', '', $vendor.strtr("-$package", '-', '\\')); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function getSrc() |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | public function getHomepage() |
| 106 | 106 | { |
| 107 | - return $this->getItem('homepage') ?: ($this->isDomain() ? 'http://' . $this->name . '/' : $this->getSource()); |
|
| 107 | + return $this->getItem('homepage') ?: ($this->isDomain() ? 'http://'.$this->name.'/' : $this->getSource()); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | public function getForum() |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | public function getRepositoryUrl($file) |
| 141 | 141 | { |
| 142 | - return 'https://github.com/' . $this->getFullName() . '/blob/master/' . $file; |
|
| 142 | + return 'https://github.com/'.$this->getFullName().'/blob/master/'.$file; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | public function getAuthors() |
@@ -49,16 +49,16 @@ |
||
| 49 | 49 | { |
| 50 | 50 | $path = parent::detectCommand($path); |
| 51 | 51 | |
| 52 | - return is_executable($path) ? $path : '/usr/bin/env python ' . $path; |
|
| 52 | + return is_executable($path) ? $path : '/usr/bin/env python '.$path; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function install() |
| 56 | 56 | { |
| 57 | 57 | if ($this->installer) { |
| 58 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->installer) . ' -O- | /usr/bin/env python', $exitcode); |
|
| 58 | + passthru('/usr/bin/env wget '.escapeshellarg($this->installer).' -O- | /usr/bin/env python', $exitcode); |
|
| 59 | 59 | } elseif ($this->download) { |
| 60 | - $dest = Yii::getAlias('@root/' . $this->name, false); |
|
| 61 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode); |
|
| 60 | + $dest = Yii::getAlias('@root/'.$this->name, false); |
|
| 61 | + passthru('/usr/bin/env wget '.escapeshellarg($this->download).' -O '.$dest, $exitcode); |
|
| 62 | 62 | } else { |
| 63 | 63 | $args = ['install']; |
| 64 | 64 | if (!$_SERVER['VIRTUAL_ENV']) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | unlink($tmp); |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | - Yii::warning('Written file: ' . $path, 'file'); |
|
| 47 | + Yii::warning('Written file: '.$path, 'file'); |
|
| 48 | 48 | |
| 49 | 49 | return true; |
| 50 | 50 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $path = rtrim(trim($path), '/'); |
| 62 | 62 | if (!file_exists($path)) { |
| 63 | 63 | mkdir($path, 0777, true); |
| 64 | - Yii::warning('Created dir: ' . $path . '/', 'file'); |
|
| 64 | + Yii::warning('Created dir: '.$path.'/', 'file'); |
|
| 65 | 65 | |
| 66 | 66 | return true; |
| 67 | 67 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function actionMake($version = null) |
| 27 | 27 | { |
| 28 | - $path = dirname(dirname(__DIR__)) . '/bin/hidev'; |
|
| 28 | + $path = dirname(dirname(__DIR__)).'/bin/hidev'; |
|
| 29 | 29 | echo "HiDev $this->version $this->date $this->time $this->hash\n"; |
| 30 | 30 | echo "run from $path\n"; |
| 31 | 31 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | $this->interpolate($item); |
| 15 | 15 | } |
| 16 | 16 | } elseif (is_string($data)) { |
| 17 | - $data = preg_replace_callback('/\\$(\\w+)\\[\'(.+?)\'\\]/', function ($matches) { |
|
| 17 | + $data = preg_replace_callback('/\\$(\\w+)\\[\'(.+?)\'\\]/', function($matches) { |
|
| 18 | 18 | return $this->get($matches[1], $matches[2]); |
| 19 | 19 | }, $data); |
| 20 | 20 | } |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | |
| 120 | 120 | foreach (['params', 'aliases', 'modules', 'components'] as $key) { |
| 121 | 121 | if (isset($config[$key])) { |
| 122 | - $this->{'setExtra' . ucfirst($key)}($config[$key]); |
|
| 122 | + $this->{'setExtra'.ucfirst($key)}($config[$key]); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -91,6 +91,10 @@ discard block |
||
| 91 | 91 | $this->setExtraConfig(static::readVendorConfig($vendor, 'hidev')); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | + /** |
|
| 95 | + * @param string $vendor |
|
| 96 | + * @param string $name |
|
| 97 | + */ |
|
| 94 | 98 | public function readVendorConfig($vendor, $name) |
| 95 | 99 | { |
| 96 | 100 | return static::readConfig(ConfigPlugin::path($vendor, $name)); |
@@ -98,7 +102,6 @@ discard block |
||
| 98 | 102 | |
| 99 | 103 | /** |
| 100 | 104 | * Sets extra environment variables. |
| 101 | - * @param array $config |
|
| 102 | 105 | */ |
| 103 | 106 | public function setExtraEnv($vars) |
| 104 | 107 | { |
@@ -199,8 +202,8 @@ discard block |
||
| 199 | 202 | |
| 200 | 203 | /** |
| 201 | 204 | * Run request. |
| 202 | - * @param string|array $query |
|
| 203 | - * @return Response |
|
| 205 | + * @param string $query |
|
| 206 | + * @return \yii\console\Response |
|
| 204 | 207 | */ |
| 205 | 208 | public function runRequest($query) |
| 206 | 209 | { |