2 declare(strict_types=1);
3 namespace wcf\system\option\user\group;
6 * User group option type implementation for integer input fields.
8 * The merge of option values returns -1 if all values are -1 otherwise the lowest
12 * @copyright 2001-2018 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\Option\User\Group
16 class InfiniteInverseIntegerUserGroupOptionType extends InverseIntegerUserGroupOptionType {
20 public function merge($defaultValue, $groupValue) {
21 if ($groupValue == -1 || $defaultValue == $groupValue) {
25 if ($defaultValue == -1) {
29 return min($defaultValue, $groupValue);
35 public function compare($value1, $value2) {
36 if ($value1 == $value2) {
43 else if ($value2 == -1) {
47 return ($value1 < $value2) ? 1 : -1;