@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class FileController extends CollectionController |
| 23 | 23 | { |
| 24 | - protected $_make = ['load', 'save', 'modify']; |
|
| 24 | + protected $_make = ['load', 'save', 'modify']; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var string specifies handler to be used |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function renderType($data) |
| 25 | 25 | { |
| 26 | - return Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . "\n"; |
|
| 26 | + return Json::encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)."\n"; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | $res = implode("\n", array_filter($lines)); |
| 214 | 214 | |
| 215 | - return $res ? $res . "\n" : ''; |
|
| 215 | + return $res ? $res."\n" : ''; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | public static function renderCommit($commit) |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | public static function renderHeader($string) |
| 264 | 264 | { |
| 265 | - $header = Yii::$app->config->package->fullName . ' ' . $string; |
|
| 265 | + $header = Yii::$app->config->package->fullName.' '.$string; |
|
| 266 | 266 | |
| 267 | - return $header . "\n" . str_repeat('-', mb_strlen($header, Yii::$app->charset)) . "\n"; |
|
| 267 | + return $header."\n".str_repeat('-', mb_strlen($header, Yii::$app->charset))."\n"; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | public static function getVcs() |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $res = ''; |
| 49 | 49 | foreach ($comments as $comment => $items) { |
| 50 | 50 | ksort($items); |
| 51 | - $res .= static::renderComment($comment) . implode("\n", $items) . "\n"; |
|
| 51 | + $res .= static::renderComment($comment).implode("\n", $items)."\n"; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return ltrim($res); |
@@ -56,6 +56,6 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | public static function renderComment($comment) |
| 58 | 58 | { |
| 59 | - return "\n#" . ($comment[0] === '#' ? '' : ' ') . "$comment\n"; |
|
| 59 | + return "\n#".($comment[0] === '#' ? '' : ' ')."$comment\n"; |
|
| 60 | 60 | } |
| 61 | 61 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if (!is_file($path) || file_get_contents($path) !== $content) { |
| 127 | 127 | $this->mkdir(dirname($path)); |
| 128 | 128 | file_put_contents($path, $content); |
| 129 | - Yii::warning('Written file: ' . $path, 'file'); |
|
| 129 | + Yii::warning('Written file: '.$path, 'file'); |
|
| 130 | 130 | |
| 131 | 131 | return true; |
| 132 | 132 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $path = trim(trim($path), '/'); |
| 145 | 145 | if (!file_exists($path)) { |
| 146 | 146 | mkdir($path, 0777, true); |
| 147 | - Yii::warning('Created dir: ' . $path . '/', 'file'); |
|
| 147 | + Yii::warning('Created dir: '.$path.'/', 'file'); |
|
| 148 | 148 | |
| 149 | 149 | return true; |
| 150 | 150 | } |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | public function read($path, $asArray = false) |
| 162 | 162 | { |
| 163 | 163 | if (file_exists($path)) { |
| 164 | - Yii::info('Read file: ' . $path, 'file'); |
|
| 164 | + Yii::info('Read file: '.$path, 'file'); |
|
| 165 | 165 | |
| 166 | 166 | return $asArray ? file($path) : file_get_contents($path); |
| 167 | 167 | } else { |
| 168 | - Yii::error('Couldn\'t read file: ' . $path, 'file'); |
|
| 168 | + Yii::error('Couldn\'t read file: '.$path, 'file'); |
|
| 169 | 169 | |
| 170 | 170 | return; |
| 171 | 171 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | { |
| 38 | 38 | $items = []; |
| 39 | 39 | foreach ($this->takeGoal('binaries')->keys() as $name) { |
| 40 | - $items[$name . '.phar'] = 'PHARs'; |
|
| 40 | + $items[$name.'.phar'] = 'PHARs'; |
|
| 41 | 41 | } |
| 42 | 42 | unset($items['git.phar']); |
| 43 | 43 | $this->takeVcs()->setIgnore($items); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $exists = false; |
| 39 | 39 | } |
| 40 | 40 | if ($exists) { |
| 41 | - $this->setItem('vendorRequire', str_pad($vendorPlugin . ':', 23) . ' "*"'); |
|
| 41 | + $this->setItem('vendorRequire', str_pad($vendorPlugin.':', 23).' "*"'); |
|
| 42 | 42 | $this->setItem('novendor', true); |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->package = $package; |
| 47 | 47 | } |
| 48 | 48 | if (!$this->package || !$this->vendor) { |
| 49 | - throw new InvalidParamException('Wrong vendor/package given: ' . $name); |
|
| 49 | + throw new InvalidParamException('Wrong vendor/package given: '.$name); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $cur = (integer) date('Y'); |
| 35 | 35 | $old = (integer) $this->year; |
| 36 | 36 | |
| 37 | - return ($old && $old < $cur ? $this->year . '-' : '') . $cur; |
|
| 37 | + return ($old && $old < $cur ? $this->year.'-' : '').$cur; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function getYear() |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function getIssues() |
| 51 | 51 | { |
| 52 | - return $this->getItem('issues') ?: ($this->source . '/issues'); |
|
| 52 | + return $this->getItem('issues') ?: ($this->source.'/issues'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function getWiki() |
| 56 | 56 | { |
| 57 | - return $this->getItem('wiki') ?: ($this->source . '/wiki'); |
|
| 57 | + return $this->getItem('wiki') ?: ($this->source.'/wiki'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function getKeywords() |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function getFullName() |
| 66 | 66 | { |
| 67 | - return $this->getItem('fullName') ?: ($this->takeVendor()->name . '/' . $this->name); |
|
| 67 | + return $this->getItem('fullName') ?: ($this->takeVendor()->name.'/'.$this->name); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function getSource() |
| 71 | 71 | { |
| 72 | - return $this->getItem('source') ?: ('https://github.com/' . $this->takeGoal('github')->full_name); |
|
| 72 | + return $this->getItem('source') ?: ('https://github.com/'.$this->takeGoal('github')->full_name); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public function getVersion() |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public static function defaultNamespace($vendor, $package) |
| 86 | 86 | { |
| 87 | - return preg_replace('/[^a-zA-Z0-9\\\\]+/', '', $vendor . strtr("-$package", '-', '\\')); |
|
| 87 | + return preg_replace('/[^a-zA-Z0-9\\\\]+/', '', $vendor.strtr("-$package", '-', '\\')); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | public function getSrc() |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function getHomepage() |
| 98 | 98 | { |
| 99 | - return $this->getItem('homepage') ?: ($this->isDomain() ? 'http://' . $this->name . '/' : $this->getSource()); |
|
| 99 | + return $this->getItem('homepage') ?: ($this->isDomain() ? 'http://'.$this->name.'/' : $this->getSource()); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | public function getForum() |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | public function getRepositoryUrl($file) |
| 133 | 133 | { |
| 134 | - return 'https://github.com/' . $this->getFullName() . '/blob/master/' . $file; |
|
| 134 | + return 'https://github.com/'.$this->getFullName().'/blob/master/'.$file; |
|
| 135 | 135 | } |
| 136 | 136 | public function getAuthors() |
| 137 | 137 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function getFull_name() |
| 36 | 36 | { |
| 37 | - return $this->getVendor() . '/' . $this->getName(); |
|
| 37 | + return $this->getVendor().'/'.$this->getName(); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function setFullName($value) |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function actionCreate() |
| 97 | 97 | { |
| 98 | - $res = $this->request('POST', '/orgs/' . $this->getVendor() . '/repos', [ |
|
| 98 | + $res = $this->request('POST', '/orgs/'.$this->getVendor().'/repos', [ |
|
| 99 | 99 | 'name' => $this->getName(), |
| 100 | 100 | 'description' => $this->getDescription(), |
| 101 | 101 | ]); |
@@ -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 | public function actionRelease($version = null) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | return $wait; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - return $this->request('POST', '/repos/' . $this->getFull_name() . '/releases', [ |
|
| 151 | + return $this->request('POST', '/repos/'.$this->getFull_name().'/releases', [ |
|
| 152 | 152 | 'tag_name' => $version, |
| 153 | 153 | 'name' => $version, |
| 154 | 154 | 'body' => $notes, |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | public function request($method, $path, $data) |
| 171 | 171 | { |
| 172 | - $url = 'https://api.github.com' . $path; |
|
| 172 | + $url = 'https://api.github.com'.$path; |
|
| 173 | 173 | |
| 174 | - return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token ' . $this->getToken(), '--data', Json::encode($data), $url]); |
|
| 174 | + return $this->passthru('curl', ['-X', $method, '-H', 'Authorization: token '.$this->getToken(), '--data', Json::encode($data), $url]); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | public function findToken() |