@@ -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); |
@@ -83,11 +83,17 @@ discard block |
||
| 83 | 83 | return [$type, $name]; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | + /** |
|
| 87 | + * @return string |
|
| 88 | + */ |
|
| 86 | 89 | public function getType() |
| 87 | 90 | { |
| 88 | 91 | return $this->_type; |
| 89 | 92 | } |
| 90 | 93 | |
| 94 | + /** |
|
| 95 | + * @return string |
|
| 96 | + */ |
|
| 91 | 97 | public function getName() |
| 92 | 98 | { |
| 93 | 99 | return $this->_name; |
@@ -141,7 +147,7 @@ discard block |
||
| 141 | 147 | * |
| 142 | 148 | * @param string $type |
| 143 | 149 | * @param string $name |
| 144 | - * @return static|null |
|
| 150 | + * @return AssetPackage |
|
| 145 | 151 | */ |
| 146 | 152 | public static function findOne($type, $name) |
| 147 | 153 | { |
@@ -202,6 +208,9 @@ discard block |
||
| 202 | 208 | return $releases; |
| 203 | 209 | } |
| 204 | 210 | |
| 211 | + /** |
|
| 212 | + * @param string $version |
|
| 213 | + */ |
|
| 205 | 214 | public function prepareUid($version) |
| 206 | 215 | { |
| 207 | 216 | $known = $this->getSaved()->getRelease($version); |