@@ -66,6 +66,9 @@ discard block |
||
66 | 66 | return $this->_type; |
67 | 67 | } |
68 | 68 | |
69 | + /** |
|
70 | + * @return string |
|
71 | + */ |
|
69 | 72 | public function getName() |
70 | 73 | { |
71 | 74 | return $this->_name; |
@@ -115,7 +118,7 @@ discard block |
||
115 | 118 | * |
116 | 119 | * @param string $type |
117 | 120 | * @param string $name |
118 | - * @return static|null |
|
121 | + * @return AssetPackage |
|
119 | 122 | */ |
120 | 123 | static public function findOne($type, $name) |
121 | 124 | { |
@@ -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); |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace hiqdev\assetpackagist\models; |
4 | 4 | |
5 | 5 | use hiqdev\assetpackagist\helpers\Locker; |
6 | -use Exception; |
|
7 | 6 | use Yii; |
8 | 7 | use yii\helpers\Json; |
9 | 8 |