From: Tim Düsterhus Date: Wed, 10 Aug 2022 09:05:57 +0000 (+0200) Subject: Remove PackageInstallationDispatcher::convertShorthandByteValue() X-Git-Tag: 6.0.0_Alpha_1~1045^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a344d15a61270c7fc1a2e9d7acfd4fd3763475aa;p=GitHub%2FWoltLab%2FWCF.git Remove PackageInstallationDispatcher::convertShorthandByteValue() This method existed for use with compareSetting(). --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index e3357287d7..baa56129f9 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -1213,34 +1213,4 @@ class PackageInstallationDispatcher $this->queue = new PackageInstallationQueue($this->queue->queueID); } } - - /** - * Converts shorthand byte values into an integer representing bytes. - * - * @param string $value - * @return int - * @see http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes - */ - protected static function convertShorthandByteValue($value) - { - // convert into bytes - $lastCharacter = \mb_substr($value, -1); - switch ($lastCharacter) { - case 'g': // gigabytes - return (int)$value * 1073741824; - break; - - case 'm': // megabytes - return (int)$value * 1048576; - break; - - case 'k': // kilobytes - return (int)$value * 1024; - break; - - default: - return $value; - break; - } - } }