@@ -72,6 +72,9 @@ |
||
| 72 | 72 | return false; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | + /** |
|
| 76 | + * @param string $id |
|
| 77 | + */ |
|
| 75 | 78 | public function getGoal($id) |
| 76 | 79 | { |
| 77 | 80 | return Yii::$app->createControllerById($id); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | /** |
| 114 | 114 | * Action to check if repo exists. |
| 115 | 115 | * @param string $repo full name vendor/package defaults to this repo name |
| 116 | - * @return int exit code |
|
| 116 | + * @return boolean exit code |
|
| 117 | 117 | */ |
| 118 | 118 | public function actionExists($repo = null) |
| 119 | 119 | { |
@@ -160,6 +160,10 @@ discard block |
||
| 160 | 160 | return 0; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | + /** |
|
| 164 | + * @param string $method |
|
| 165 | + * @param string $path |
|
| 166 | + */ |
|
| 163 | 167 | public function request($method, $path, $data) |
| 164 | 168 | { |
| 165 | 169 | $url = 'https://api.github.com' . $path; |
@@ -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() |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @param mixed $data |
| 93 | 93 | * |
| 94 | - * @return string file content |
|
| 94 | + * @return boolean file content |
|
| 95 | 95 | */ |
| 96 | 96 | public function renderPath($path, $data) |
| 97 | 97 | { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * Read file into a string or array. |
| 157 | 157 | * @param string $path |
| 158 | 158 | * @param bool $asArray |
| 159 | - * @return string|array |
|
| 159 | + * @return string |
|
| 160 | 160 | */ |
| 161 | 161 | public function read($path, $asArray = false) |
| 162 | 162 | { |
@@ -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 | } |
@@ -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 | /** |
@@ -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 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $a = pathinfo($template); |
| 22 | 22 | |
| 23 | - return $a['dirname'] . '/' . $a['filename'] . $extension; |
|
| 23 | + return $a['dirname'].'/'.$a['filename'].$extension; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function actionPerform($template = null, $file = null) |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function getTitleAndHomepage() |
| 34 | 34 | { |
| 35 | - return $this->title . ($this->homepage ? ' (' . $this->homepage . ')' : ''); |
|
| 35 | + return $this->title.($this->homepage ? ' ('.$this->homepage.')' : ''); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function getDescription() |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | if ($style) { |
| 47 | 47 | $message = Console::ansiFormat($message, $style); |
| 48 | 48 | } |
| 49 | - Console::stdout($message . "\n"); |
|
| 49 | + Console::stdout($message."\n"); |
|
| 50 | 50 | } |
| 51 | 51 | parent::log($message, $level, $category); |
| 52 | 52 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | public function renderPath($path, $data) |
| 25 | 25 | { |
| 26 | 26 | copy($data->getCopy(), $path); |
| 27 | - Yii::warning('Copied file: ' . $path); |
|
| 27 | + Yii::warning('Copied file: '.$path); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |