From: Tim Düsterhus Date: Wed, 10 Aug 2022 09:04:51 +0000 (+0200) Subject: Remove PackageInstallationDispatcher::compareSetting() X-Git-Tag: 6.0.0_Alpha_1~1045^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a28b68ea1cc1edaacb90ab813b0c69b3d37dd8be;p=GitHub%2FWoltLab%2FWCF.git Remove PackageInstallationDispatcher::compareSetting() This method existed for use with validatePHPRequirements(). --- diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index f2eaf94cd8..e3357287d7 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -1214,38 +1214,6 @@ class PackageInstallationDispatcher } } - /** - * Compares settings, converting values into compareable ones. - * - * @param string $setting - * @param string $value - * @param mixed $compareValue - * @return bool - */ - protected static function compareSetting($setting, $value, $compareValue) - { - if ($compareValue === false) { - return false; - } - - $value = \mb_strtolower($value); - $trueValues = ['1', 'on', 'true']; - $falseValues = ['0', 'off', 'false']; - - // handle values considered as 'true' - if (\in_array($value, $trueValues)) { - return $compareValue ? true : false; - } // handle values considered as 'false' - elseif (\in_array($value, $falseValues)) { - return (!$compareValue) ? true : false; - } elseif (!\is_numeric($value)) { - $compareValue = self::convertShorthandByteValue($compareValue); - $value = self::convertShorthandByteValue($value); - } - - return ($compareValue >= $value) ? true : false; - } - /** * Converts shorthand byte values into an integer representing bytes. *