mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 09:42:43 +01:00
Extract constant API_RELEASE_URI
in Updater
class
This commit is contained in:
parent
046680996a
commit
ec7ebdee22
@ -18,6 +18,13 @@ class Updater
|
||||
*/
|
||||
protected const REPOSITORY = 'getformwork/formwork';
|
||||
|
||||
/**
|
||||
* GitHub API latest release URI
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected const API_RELEASE_URI = 'https://api.github.com/repos/' . self::REPOSITORY . '/releases/latest';
|
||||
|
||||
/**
|
||||
* Updater options
|
||||
*
|
||||
@ -242,8 +249,7 @@ class Updater
|
||||
return;
|
||||
}
|
||||
|
||||
$uri = 'https://api.github.com/repos/' . self::REPOSITORY . '/releases/latest';
|
||||
$data = json_decode(FileSystem::fetch($uri, $this->context), true);
|
||||
$data = json_decode(FileSystem::fetch(self::API_RELEASE_URI, $this->context), true);
|
||||
|
||||
if (!$data) {
|
||||
throw new RuntimeException('Cannot fetch latest Formwork release data');
|
||||
|
Loading…
x
Reference in New Issue
Block a user