@@ -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 | } |
@@ -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() |
@@ -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() |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected static $_extension2type = [ |
125 | 125 | 'json' => 'json', |
126 | - 'yml' => 'yaml', /// first one is preferred |
|
126 | + 'yml' => 'yaml', /// first one is preferred |
|
127 | 127 | 'yaml' => 'yaml', |
128 | 128 | 'xml' => 'xml', |
129 | 129 | 'xml.dist' => 'xml', |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | public function setBasename($basename) |
178 | 178 | { |
179 | - $this->setPath($this->_dirname . '/' . $basename); |
|
179 | + $this->setPath($this->_dirname.'/'.$basename); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | public function getBasename() |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | public function setDirname($dirname) |
188 | 188 | { |
189 | - $this->setPath($dirname . '/' . $this->_basename); |
|
189 | + $this->setPath($dirname.'/'.$this->_basename); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | public function getDirname() |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | public function setFilename($filename) |
198 | 198 | { |
199 | - $this->setPath($this->_dirname . '/' . $filename . '.' . $this->_extension); |
|
199 | + $this->setPath($this->_dirname.'/'.$filename.'.'.$this->_extension); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | public function getFilename() |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | public function setExtension($extension) |
208 | 208 | { |
209 | - $this->setPath($this->_dirname . '/' . $this->_filename . '.' . $extension); |
|
209 | + $this->setPath($this->_dirname.'/'.$this->_filename.'.'.$extension); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | public function getExtension() |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | { |
258 | 258 | if (!is_object($this->_handler)) { |
259 | 259 | $this->_handler = Yii::createObject([ |
260 | - 'class' => 'hidev\handlers\\' . $this->getCtype() . 'Handler', |
|
260 | + 'class' => 'hidev\handlers\\'.$this->getCtype().'Handler', |
|
261 | 261 | 'template' => $this->template, |
262 | 262 | 'goal' => $this->goal, |
263 | 263 | ]); |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | |
361 | 361 | public function chown($value) |
362 | 362 | { |
363 | - $ownergroup = $this->getOwner() . ':' . $this->getGroup(); |
|
363 | + $ownergroup = $this->getOwner().':'.$this->getGroup(); |
|
364 | 364 | if (in_array((string) $value, [$ownergroup, $this->getOwner(), $this->getUid()], true)) { |
365 | 365 | return; |
366 | 366 | } |
@@ -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 | } |