From b4263fd766808918ecd9e9205ee3086f2e5b1eab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 6 Jul 2021 12:49:19 +0200 Subject: [PATCH] Use temporary variables for `Request` objects in FontManager This is for consistency with other code sending HTTP requests and to shorten the lines, as one of them exceeded 120 characters. --- .../install/files/lib/system/style/FontManager.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/style/FontManager.class.php b/wcfsetup/install/files/lib/system/style/FontManager.class.php index 58466c4c87..4dc25d2110 100644 --- a/wcfsetup/install/files/lib/system/style/FontManager.class.php +++ b/wcfsetup/install/files/lib/system/style/FontManager.class.php @@ -69,7 +69,8 @@ class FontManager extends SingletonFactory */ public function fetchAvailableFamilies() { - $response = $this->http->send(new Request('GET', 'families.json')); + $request = new Request('GET', 'families.json'); + $response = $this->http->send($request); return JSON::decode($response->getBody()); } @@ -84,7 +85,8 @@ class FontManager extends SingletonFactory public function downloadFamily($family) { try { - $response = $this->http->send(new Request('GET', \rawurlencode($family) . '/manifest.json')); + $request = new Request('GET', \rawurlencode($family) . '/manifest.json'); + $response = $this->http->send($request); $manifest = JSON::decode($response->getBody()); $familyDirectory = \dirname($this->getCssFilename($family)); @@ -103,7 +105,8 @@ class FontManager extends SingletonFactory throw new \InvalidArgumentException("Invalid filename '" . $filename . "' given."); } - $response = $this->http->send(new Request('GET', \rawurlencode($family) . '/' . \rawurlencode($filename))); + $request = new Request('GET', \rawurlencode($family) . '/' . \rawurlencode($filename)); + $response = $this->http->send($request); $file = new AtomicWriter($familyDirectory . '/' . $filename); while (!$response->getBody()->eof()) { -- 2.20.1