From ec7ebdee225993394ba44f14030ef376ad0719bc Mon Sep 17 00:00:00 2001 From: Giuseppe Criscione Date: Sat, 15 Feb 2020 12:48:05 +0100 Subject: [PATCH] Extract constant `API_RELEASE_URI` in `Updater` class --- admin/src/Updater.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/src/Updater.php b/admin/src/Updater.php index e08ed395..eb2bd46e 100644 --- a/admin/src/Updater.php +++ b/admin/src/Updater.php @@ -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');