From: Tim Düsterhus Date: Tue, 6 Jul 2021 10:49:19 +0000 (+0200) Subject: Use temporary variables for `Request` objects in FontManager X-Git-Tag: 5.5.0_Alpha_1~553 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b4263fd766808918ecd9e9205ee3086f2e5b1eab;p=GitHub%2FWoltLab%2FWCF.git 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. --- 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()) {