@@ -24,6 +24,9 @@ |
||
| 24 | 24 | echo 'updated ' . $package->getHash() . ' ' . $package->getFullName() . "\n"; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string|boolean $file |
|
| 29 | + */ |
|
| 27 | 30 | public function actionUpdateList($file = STDIN) |
| 28 | 31 | { |
| 29 | 32 | $handler = is_resource($file) ? $file : fopen($file, 'r'); |
@@ -56,6 +56,9 @@ discard block |
||
| 56 | 56 | return file_exists($path) ? (int)file_get_contents($path) : 1000000; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param integer $value |
|
| 61 | + */ |
|
| 59 | 62 | protected function writeLastId($value) |
| 60 | 63 | { |
| 61 | 64 | file_put_contents($this->getLastIDPath(), $value); |
@@ -114,11 +117,18 @@ discard block |
||
| 114 | 117 | return implode(DIRECTORY_SEPARATOR, $args); |
| 115 | 118 | } |
| 116 | 119 | |
| 120 | + /** |
|
| 121 | + * @param string $name |
|
| 122 | + */ |
|
| 117 | 123 | public function buildHashedPath($name, $hash = 'latest') |
| 118 | 124 | { |
| 119 | 125 | return $this->buildPath('p', $name, $hash . '.json'); |
| 120 | 126 | } |
| 121 | 127 | |
| 128 | + /** |
|
| 129 | + * @param string $name |
|
| 130 | + * @param string $hash |
|
| 131 | + */ |
|
| 122 | 132 | protected function writeProviderLatest($name, $hash) |
| 123 | 133 | { |
| 124 | 134 | $latest_path = $this->buildHashedPath('provider-latest'); |
@@ -149,6 +159,9 @@ discard block |
||
| 149 | 159 | return $hash; |
| 150 | 160 | } |
| 151 | 161 | |
| 162 | + /** |
|
| 163 | + * @param string $hash |
|
| 164 | + */ |
|
| 152 | 165 | protected function writePackagesJson($hash) |
| 153 | 166 | { |
| 154 | 167 | $data = [ |
@@ -167,6 +180,9 @@ discard block |
||
| 167 | 180 | $this->getLocker()->release(); |
| 168 | 181 | } |
| 169 | 182 | |
| 183 | + /** |
|
| 184 | + * @param string $dir |
|
| 185 | + */ |
|
| 170 | 186 | public static function mkdir($dir) |
| 171 | 187 | { |
| 172 | 188 | if (!file_exists($dir)) { |
@@ -186,6 +202,9 @@ discard block |
||
| 186 | 202 | return $data['provider-includes']; |
| 187 | 203 | } |
| 188 | 204 | |
| 205 | + /** |
|
| 206 | + * @param string $path |
|
| 207 | + */ |
|
| 189 | 208 | protected function readProvider($path) |
| 190 | 209 | { |
| 191 | 210 | $data = $this->readJson($path); |
@@ -103,11 +103,17 @@ discard block |
||
| 103 | 103 | return [$type, $name]; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | + /** |
|
| 107 | + * @return string |
|
| 108 | + */ |
|
| 106 | 109 | public function getType() |
| 107 | 110 | { |
| 108 | 111 | return $this->_type; |
| 109 | 112 | } |
| 110 | 113 | |
| 114 | + /** |
|
| 115 | + * @return string |
|
| 116 | + */ |
|
| 111 | 117 | public function getName() |
| 112 | 118 | { |
| 113 | 119 | return $this->_name; |
@@ -166,7 +172,7 @@ discard block |
||
| 166 | 172 | * |
| 167 | 173 | * @param string $type |
| 168 | 174 | * @param string $name |
| 169 | - * @return static|null |
|
| 175 | + * @return AssetPackage |
|
| 170 | 176 | */ |
| 171 | 177 | public static function findOne($type, $name) |
| 172 | 178 | { |
@@ -229,6 +235,9 @@ discard block |
||
| 229 | 235 | return $releases; |
| 230 | 236 | } |
| 231 | 237 | |
| 238 | + /** |
|
| 239 | + * @param string $version |
|
| 240 | + */ |
|
| 232 | 241 | public function prepareUid($version) |
| 233 | 242 | { |
| 234 | 243 | $known = $this->getSaved()->getRelease($version); |
@@ -265,7 +274,7 @@ discard block |
||
| 265 | 274 | |
| 266 | 275 | /** |
| 267 | 276 | * Returns the latest update time (UNIX Epoch) |
| 268 | - * @return int|null |
|
| 277 | + * @return integer |
|
| 269 | 278 | */ |
| 270 | 279 | public function getUpdateTime() |
| 271 | 280 | { |