1
1
<?php
2
2
3
+ declare (strict_types=1 );
4
+
3
5
namespace Codedge \Updater \SourceRepositoryTypes ;
4
6
5
7
use Codedge \Updater \AbstractRepositoryType ;
10
12
use File ;
11
13
use GuzzleHttp \Client ;
12
14
use Illuminate \Database \Eloquent \Collection ;
15
+ use Psr \Http \Message \ResponseInterface ;
13
16
use Storage ;
14
17
use Symfony \Component \Finder \Finder ;
15
18
@@ -29,7 +32,7 @@ class HttpRepositoryType extends AbstractRepositoryType implements SourceReposit
29
32
protected $ client ;
30
33
31
34
/**
32
- * @var Version prepand string
35
+ * @var Version prepend string
33
36
*/
34
37
protected $ prepend ;
35
38
@@ -53,6 +56,8 @@ public function __construct(Client $client, array $config)
53
56
// Get prepend and append strings
54
57
$ this ->prepend = preg_replace ('/_VERSION_.*$/ ' , '' , $ this ->config ['pkg_filename_format ' ]);
55
58
$ this ->append = preg_replace ('/^.*_VERSION_/ ' , '' , $ this ->config ['pkg_filename_format ' ]);
59
+
60
+ $ this ->setAccessToken ($ config ['private_access_token ' ]);
56
61
}
57
62
58
63
/**
@@ -196,6 +201,8 @@ public function getVersionInstalled($prepend = '', $append = '') : string
196
201
* @param string $prepend Prepend a string to the latest version
197
202
* @param string $append Append a string to the latest version
198
203
*
204
+ * @throws \Exception
205
+ *
199
206
* @return string
200
207
*/
201
208
public function getVersionAvailable ($ prepend = '' , $ append = '' ) : string
@@ -217,9 +224,9 @@ public function getVersionAvailable($prepend = '', $append = '') : string
217
224
/**
218
225
* Retrieve html body with list of all releases from archive URL.
219
226
*
220
- * @throws \Exception
227
+ *@throws \Exception
221
228
*
222
- * @return mixed|\Psr\Http\Message\ ResponseInterface
229
+ * @return mixed|ResponseInterface
223
230
*/
224
231
protected function getPackageReleases ()
225
232
{
0 commit comments