@@ -14,7 +14,7 @@ |
||
14 | 14 | 'name' => 'HiDev', |
15 | 15 | 'basePath' => dirname(__DIR__), |
16 | 16 | 'vendorPath' => HIDEV_VENDOR_DIR, |
17 | - 'runtimePath' => substr(__DIR__, 0, 7) === 'phar://' ? dirname($_SERVER['SCRIPT_NAME']) : dirname(HIDEV_VENDOR_DIR) . '/runtime', |
|
17 | + 'runtimePath' => substr(__DIR__, 0, 7) === 'phar://' ? dirname($_SERVER['SCRIPT_NAME']) : dirname(HIDEV_VENDOR_DIR).'/runtime', |
|
18 | 18 | 'enableCoreCommands' => false, |
19 | 19 | 'controllerNamespace' => 'hidev\\controllers', |
20 | 20 | 'defaultRoute' => 'default', |
@@ -146,11 +146,11 @@ |
||
146 | 146 | public function read($path, $asArray = false) |
147 | 147 | { |
148 | 148 | if (file_exists($path)) { |
149 | - Yii::info('Read file: ' . $path, 'file'); |
|
149 | + Yii::info('Read file: '.$path, 'file'); |
|
150 | 150 | |
151 | 151 | return $asArray ? file($path) : file_get_contents($path); |
152 | 152 | } else { |
153 | - Yii::error('Couldn\'t read file: ' . $path, 'file'); |
|
153 | + Yii::error('Couldn\'t read file: '.$path, 'file'); |
|
154 | 154 | |
155 | 155 | return; |
156 | 156 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | public function actionSave() |
53 | 53 | { |
54 | - $this->getFile()->write(implode(' ', [$this->version, $this->date, $this->time, $this->zone, $this->hash]) . "\n"); |
|
54 | + $this->getFile()->write(implode(' ', [$this->version, $this->date, $this->time, $this->zone, $this->hash])."\n"); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setVersion($version = null) |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $this->package = $package; |
50 | 50 | } |
51 | 51 | if (!$this->package || !$this->vendor) { |
52 | - throw new InvalidParamException('Wrong vendor/package given: ' . $name); |
|
52 | + throw new InvalidParamException('Wrong vendor/package given: '.$name); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | { |
47 | 47 | $path = parent::detectCommand($path); |
48 | 48 | |
49 | - return is_executable($path) ? $path : '/usr/bin/env php ' . $path; |
|
49 | + return is_executable($path) ? $path : '/usr/bin/env php '.$path; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function install() |
53 | 53 | { |
54 | 54 | if ($this->installer) { |
55 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->installer) . ' -O- | /usr/bin/env php', $exitcode); |
|
55 | + passthru('/usr/bin/env wget '.escapeshellarg($this->installer).' -O- | /usr/bin/env php', $exitcode); |
|
56 | 56 | } elseif ($this->download) { |
57 | - $dest = Yii::getAlias('@root/' . $this->name . '.phar', false); |
|
58 | - passthru('/usr/bin/env wget ' . escapeshellarg($this->download) . ' -O ' . $dest, $exitcode); |
|
57 | + $dest = Yii::getAlias('@root/'.$this->name.'.phar', false); |
|
58 | + passthru('/usr/bin/env wget '.escapeshellarg($this->download).' -O '.$dest, $exitcode); |
|
59 | 59 | } else { |
60 | 60 | return parent::install(); |
61 | 61 | } |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | |
66 | 66 | public function getVcsignore() |
67 | 67 | { |
68 | - return $this->name . '.phar'; |
|
68 | + return $this->name.'.phar'; |
|
69 | 69 | } |
70 | 70 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public static function readExtraVendor($dir) |
72 | 72 | { |
73 | - return static::readExtraConfig($dir . '/hiqdev/composer-config-plugin-output/hidev.php'); |
|
73 | + return static::readExtraConfig($dir.'/hiqdev/composer-config-plugin-output/hidev.php'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public static function readExtraConfig($path) |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | foreach (['params', 'aliases', 'modules', 'components'] as $key) { |
108 | 108 | if (isset($config[$key])) { |
109 | - $this->{'setExtra' . ucfirst($key)}($config[$key]); |
|
109 | + $this->{'setExtra'.ucfirst($key)}($config[$key]); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 |
@@ -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 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | public function getFull_name() |
35 | 35 | { |
36 | - return $this->getVendor() . '/' . $this->getName(); |
|
36 | + return $this->getVendor().'/'.$this->getName(); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function setFullName($value) |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function actionCreate() |
96 | 96 | { |
97 | - $res = $this->request('POST', '/orgs/' . $this->getVendor() . '/repos', [ |
|
97 | + $res = $this->request('POST', '/orgs/'.$this->getVendor().'/repos', [ |
|
98 | 98 | 'name' => $this->getName(), |
99 | 99 | 'description' => $this->getDescription(), |
100 | 100 | ]); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function actionClone($repo) |
116 | 116 | { |
117 | - return $this->passthru('git', ['clone', '[email protected]:' . $repo]); |
|
117 | + return $this->passthru('git', ['clone', '[email protected]:'.$repo]); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public static function exists($repo) |
136 | 136 | { |
137 | - return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true); |
|
137 | + return !static::exec('git', ['ls-remote', '[email protected]:'.$repo], true); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return $wait; |
150 | 150 | } |
151 | 151 | |
152 | - return $this->request('POST', '/repos/' . $this->getFull_name() . '/releases', [ |
|
152 | + return $this->request('POST', '/repos/'.$this->getFull_name().'/releases', [ |
|
153 | 153 | 'tag_name' => $version, |
154 | 154 | 'name' => $version, |
155 | 155 | 'body' => $notes, |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | |
171 | 171 | public function request($method, $path, $data) |
172 | 172 | { |
173 | - $url = 'https://api.github.com' . $path; |
|
173 | + $url = 'https://api.github.com'.$path; |
|
174 | 174 | |
175 | - return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token ' . $this->getToken(), '--data', Json::encode($data), $url]); |
|
175 | + return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token '.$this->getToken(), '--data', Json::encode($data), $url]); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | public function findToken() |