1- <?php
1+ <?php declare (strict_types= 1 );
22
33namespace Codedge \Updater \SourceRepositoryTypes ;
44
1010use File ;
1111use GuzzleHttp \Client ;
1212use Illuminate \Database \Eloquent \Collection ;
13+ use Psr \Http \Message \ResponseInterface ;
1314use Storage ;
1415use Symfony \Component \Finder \Finder ;
1516
@@ -29,7 +30,7 @@ class HttpRepositoryType extends AbstractRepositoryType implements SourceReposit
2930 protected $ client ;
3031
3132 /**
32- * @var Version prepand string
33+ * @var Version prepend string
3334 */
3435 protected $ prepend ;
3536
@@ -53,6 +54,8 @@ public function __construct(Client $client, array $config)
5354 // Get prepend and append strings
5455 $ this ->prepend = preg_replace ('/_VERSION_.*$/ ' , '' , $ this ->config ['pkg_filename_format ' ]);
5556 $ this ->append = preg_replace ('/^.*_VERSION_/ ' , '' , $ this ->config ['pkg_filename_format ' ]);
57+
58+ $ this ->setAccessToken ($ config ['private_access_token ' ]);
5659 }
5760
5861 /**
@@ -194,9 +197,10 @@ public function getVersionInstalled($prepend = '', $append = '') : string
194197 * Example: 2.6.5 or v2.6.5.
195198 *
196199 * @param string $prepend Prepend a string to the latest version
197- * @param string $append Append a string to the latest version
200+ * @param string $append Append a string to the latest version
198201 *
199202 * @return string
203+ * @throws \Exception
200204 */
201205 public function getVersionAvailable ($ prepend = '' , $ append = '' ) : string
202206 {
@@ -217,9 +221,9 @@ public function getVersionAvailable($prepend = '', $append = '') : string
217221 /**
218222 * Retrieve html body with list of all releases from archive URL.
219223 *
220- * @throws \Exception
224+ * @return mixed|ResponseInterface
225+ *@throws \Exception
221226 *
222- * @return mixed|\Psr\Http\Message\ResponseInterface
223227 */
224228 protected function getPackageReleases ()
225229 {
0 commit comments