@@ -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; |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | protected static $_extension2type = [ |
| 91 | 91 | 'json' => 'json', |
| 92 | - 'yml' => 'yaml', /// first one is preferred |
|
| 92 | + 'yml' => 'yaml', /// first one is preferred |
|
| 93 | 93 | 'yaml' => 'yaml', |
| 94 | 94 | 'xml' => 'xml', |
| 95 | 95 | 'xml.dist' => 'xml', |
@@ -127,6 +127,9 @@ discard block |
||
| 127 | 127 | return $type2extension[$type]; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | + /** |
|
| 131 | + * @param string $extension |
|
| 132 | + */ |
|
| 130 | 133 | public function getTypeByExtension($extension) |
| 131 | 134 | { |
| 132 | 135 | return static::$_extension2type[$extension]; |
@@ -137,6 +140,9 @@ discard block |
||
| 137 | 140 | return ($this->goal ? $this->goal->fileType : null) ?: static::getTypeByExtension($this->_extension) ?: 'template'; |
| 138 | 141 | } |
| 139 | 142 | |
| 143 | + /** |
|
| 144 | + * @param string $path |
|
| 145 | + */ |
|
| 140 | 146 | public function setPath($path) |
| 141 | 147 | { |
| 142 | 148 | $path = Yii::getAlias($path); |
@@ -213,6 +219,9 @@ discard block |
||
| 213 | 219 | return $this->handler->renderPath($this->path, $this->data); |
| 214 | 220 | } |
| 215 | 221 | |
| 222 | + /** |
|
| 223 | + * @param string $content |
|
| 224 | + */ |
|
| 216 | 225 | public function write($content) |
| 217 | 226 | { |
| 218 | 227 | return $this->handler->write($this->path, $content); |
@@ -223,6 +232,9 @@ discard block |
||
| 223 | 232 | return $this->data = $this->handler->parsePath($this->path, $this->minimalPath); |
| 224 | 233 | } |
| 225 | 234 | |
| 235 | + /** |
|
| 236 | + * @return string |
|
| 237 | + */ |
|
| 226 | 238 | public function read() |
| 227 | 239 | { |
| 228 | 240 | return $this->handler->read($this->path); |
@@ -289,6 +301,9 @@ discard block |
||
| 289 | 301 | return is_null($field) ? $this->_stat : $this->_stat[$field]; |
| 290 | 302 | } |
| 291 | 303 | |
| 304 | + /** |
|
| 305 | + * @return integer |
|
| 306 | + */ |
|
| 292 | 307 | public function getUid() |
| 293 | 308 | { |
| 294 | 309 | return $this->getStat(4); |
@@ -303,6 +318,9 @@ discard block |
||
| 303 | 318 | return $this->getStat('owner')['name']; |
| 304 | 319 | } |
| 305 | 320 | |
| 321 | + /** |
|
| 322 | + * @return integer |
|
| 323 | + */ |
|
| 306 | 324 | public function getGid() |
| 307 | 325 | { |
| 308 | 326 | return $this->getStat(5); |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | * |
| 91 | 91 | * @param mixed $data |
| 92 | 92 | * |
| 93 | - * @return string file content |
|
| 93 | + * @return boolean file content |
|
| 94 | 94 | */ |
| 95 | 95 | public function renderPath($path, $data) |
| 96 | 96 | { |
@@ -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); |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | protected function findDir() |
| 79 | 79 | { |
| 80 | 80 | $configDir = '.hidev'; |
| 81 | - for ($i = 0;$i < 9;++$i) { |
|
| 81 | + for ($i = 0; $i < 9; ++$i) { |
|
| 82 | 82 | if (is_dir($configDir)) { |
| 83 | 83 | return getcwd(); |
| 84 | 84 | } |
@@ -69,7 +69,6 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Load extra config files. |
| 72 | - * @param array $config |
|
| 73 | 72 | * @return void |
| 74 | 73 | */ |
| 75 | 74 | public function loadExtraVendor($dir) |
@@ -134,6 +133,9 @@ discard block |
||
| 134 | 133 | return $controller; |
| 135 | 134 | } |
| 136 | 135 | |
| 136 | + /** |
|
| 137 | + * @param string $string |
|
| 138 | + */ |
|
| 137 | 139 | public function runRequest($string) |
| 138 | 140 | { |
| 139 | 141 | $request = Yii::createObject([ |
@@ -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 |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * Runs list of actions. |
| 145 | 145 | * TODO: think to redo with runRequests. |
| 146 | 146 | * @param null|string|array $actions |
| 147 | - * @return int|Response exit code |
|
| 147 | + * @return null|integer exit code |
|
| 148 | 148 | */ |
| 149 | 149 | public function runActions($actions) |
| 150 | 150 | { |
@@ -221,6 +221,9 @@ discard block |
||
| 221 | 221 | return readline($prompt); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | + /** |
|
| 225 | + * @param string $prompt |
|
| 226 | + */ |
|
| 224 | 227 | public function readpassword($prompt) |
| 225 | 228 | { |
| 226 | 229 | echo $prompt; |
@@ -231,6 +234,9 @@ discard block |
||
| 231 | 234 | return $password; |
| 232 | 235 | } |
| 233 | 236 | |
| 237 | + /** |
|
| 238 | + * @param string $id |
|
| 239 | + */ |
|
| 234 | 240 | public function takeGoal($id) |
| 235 | 241 | { |
| 236 | 242 | return Yii::$app->get('config')->getGoal($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; |