@@ -59,6 +59,9 @@ discard block |
||
| 59 | 59 | $this->_hash = $hash; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $label |
|
| 64 | + */ |
|
| 62 | 65 | public function addTag($tag, $label = null) |
| 63 | 66 | { |
| 64 | 67 | $this->tag = $tag; |
@@ -66,6 +69,9 @@ discard block |
||
| 66 | 69 | $ref = $label ?: $ref ?: $tag; |
| 67 | 70 | } |
| 68 | 71 | |
| 72 | + /** |
|
| 73 | + * @param string $note |
|
| 74 | + */ |
|
| 69 | 75 | public function addNote($note, $label = null) |
| 70 | 76 | { |
| 71 | 77 | $this->note = $note; |
@@ -73,6 +79,10 @@ discard block |
||
| 73 | 79 | $ref = $label ?: $ref ?: $note; |
| 74 | 80 | } |
| 75 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $hash |
|
| 84 | + * @param string $label |
|
| 85 | + */ |
|
| 76 | 86 | public function addHash($hash, $label) |
| 77 | 87 | { |
| 78 | 88 | $this->_hash = $hash; |
@@ -183,6 +193,9 @@ discard block |
||
| 183 | 193 | return $res; |
| 184 | 194 | } |
| 185 | 195 | |
| 196 | + /** |
|
| 197 | + * @param string $key |
|
| 198 | + */ |
|
| 186 | 199 | public static function arrayPop(&$array, $key) |
| 187 | 200 | { |
| 188 | 201 | $res = $array[$key]; |
@@ -239,6 +252,9 @@ discard block |
||
| 239 | 252 | return $date ? date(' Y-m-d', strtotime($date)) : ''; |
| 240 | 253 | } |
| 241 | 254 | |
| 255 | + /** |
|
| 256 | + * @param string $string |
|
| 257 | + */ |
|
| 242 | 258 | public static function renderHeader($string) |
| 243 | 259 | { |
| 244 | 260 | $header = Yii::$app->config->package->fullName . ' ' . $string; |
@@ -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); |
@@ -122,6 +122,9 @@ discard block |
||
| 122 | 122 | return $type2extension[$type]; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $extension |
|
| 127 | + */ |
|
| 125 | 128 | public function getTypeByExtension($extension) |
| 126 | 129 | { |
| 127 | 130 | return static::$_extension2type[$extension]; |
@@ -132,6 +135,9 @@ discard block |
||
| 132 | 135 | return ($this->goal ? $this->goal->fileType : null) ?: static::getTypeByExtension($this->_extension) ?: 'template'; |
| 133 | 136 | } |
| 134 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $path |
|
| 140 | + */ |
|
| 135 | 141 | public function setPath($path) |
| 136 | 142 | { |
| 137 | 143 | $path = Yii::getAlias($path); |
@@ -208,6 +214,9 @@ discard block |
||
| 208 | 214 | return $this->handler->renderPath($this->path, $this->data); |
| 209 | 215 | } |
| 210 | 216 | |
| 217 | + /** |
|
| 218 | + * @param string $content |
|
| 219 | + */ |
|
| 211 | 220 | public function write($content) |
| 212 | 221 | { |
| 213 | 222 | return $this->handler->write($this->path, $content); |
@@ -218,6 +227,9 @@ discard block |
||
| 218 | 227 | return $this->data = $this->handler->parsePath($this->path, $this->minimalPath); |
| 219 | 228 | } |
| 220 | 229 | |
| 230 | + /** |
|
| 231 | + * @return string |
|
| 232 | + */ |
|
| 221 | 233 | public function read() |
| 222 | 234 | { |
| 223 | 235 | return $this->handler->read($this->path); |
@@ -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; |
@@ -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 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * @return int|Response exit code |
|
| 51 | + * @return null|integer exit code |
|
| 52 | 52 | */ |
| 53 | 53 | public function actionMake() |
| 54 | 54 | { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * Is response NOT Ok. |
| 144 | 144 | * @param Response|int $res |
| 145 | - * @return bool |
|
| 145 | + * @return integer |
|
| 146 | 146 | */ |
| 147 | 147 | public static function isNotOk($res) |
| 148 | 148 | { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | 153 | * Is response Ok. |
| 154 | - * @param Response|int $res |
|
| 154 | + * @param integer $res |
|
| 155 | 155 | * @return bool |
| 156 | 156 | */ |
| 157 | 157 | public static function isOk($res) |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * Runs list of actions. |
| 164 | 164 | * TODO: think to redo with runRequests. |
| 165 | 165 | * @param null|string|array $actions |
| 166 | - * @return int|Response exit code |
|
| 166 | + * @return null|integer exit code |
|
| 167 | 167 | */ |
| 168 | 168 | public function runActions($actions) |
| 169 | 169 | { |
@@ -240,6 +240,9 @@ discard block |
||
| 240 | 240 | return readline($prompt); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | + /** |
|
| 244 | + * @param string $prompt |
|
| 245 | + */ |
|
| 243 | 246 | public function readpassword($prompt) |
| 244 | 247 | { |
| 245 | 248 | echo $prompt; |
@@ -250,6 +253,9 @@ discard block |
||
| 250 | 253 | return $password; |
| 251 | 254 | } |
| 252 | 255 | |
| 256 | + /** |
|
| 257 | + * @param string $id |
|
| 258 | + */ |
|
| 253 | 259 | public static function takeGoal($id) |
| 254 | 260 | { |
| 255 | 261 | return Yii::$app->get('config')->getGoal($id); |
@@ -19,11 +19,17 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | class Helper |
| 21 | 21 | { |
| 22 | + /** |
|
| 23 | + * @return string |
|
| 24 | + */ |
|
| 22 | 25 | public static function bad2sep($str, $separator = '-') |
| 23 | 26 | { |
| 24 | 27 | return preg_replace('/[^a-zA-Z0-9-]/', $separator, $str); |
| 25 | 28 | } |
| 26 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $id |
|
| 32 | + */ |
|
| 27 | 33 | public static function id2camel($id, $separator = '-') |
| 28 | 34 | { |
| 29 | 35 | return Inflector::id2camel(self::bad2sep($id, $separator), $separator); |
@@ -35,6 +41,9 @@ discard block |
||
| 35 | 41 | return str_replace('--', '-', Inflector::camel2id(str_replace(' ', '', ucwords($name)), $separator, $strict)); |
| 36 | 42 | } |
| 37 | 43 | |
| 44 | + /** |
|
| 45 | + * @param string $file |
|
| 46 | + */ |
|
| 38 | 47 | public static function file2template($file, $separator = '-') |
| 39 | 48 | { |
| 40 | 49 | return trim($file, '.'); |
@@ -70,6 +79,9 @@ discard block |
||
| 70 | 79 | return array_combine($res, $res); |
| 71 | 80 | } |
| 72 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $subj |
|
| 84 | + */ |
|
| 73 | 85 | public static function getPublicVars($subj) |
| 74 | 86 | { |
| 75 | 87 | return is_object($subj) ? get_object_vars($subj) : get_class_vars($subj); |
@@ -86,7 +86,6 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Load extra config files. |
| 89 | - * @param array $config |
|
| 90 | 89 | */ |
| 91 | 90 | public function loadExtraVendor($dir) |
| 92 | 91 | { |
@@ -185,8 +184,8 @@ discard block |
||
| 185 | 184 | |
| 186 | 185 | /** |
| 187 | 186 | * Run request. |
| 188 | - * @param string|array $query |
|
| 189 | - * @return Response |
|
| 187 | + * @param string $query |
|
| 188 | + * @return \yii\console\Response |
|
| 190 | 189 | */ |
| 191 | 190 | public function runRequest($query) |
| 192 | 191 | { |