/home/techb158/dev.balacoffee.com/vendor/nette/utils/src/Utils
NameSizeModeActions
ArrayHash.php19050644editdlrm
ArrayList.php26740644editdlrm
Arrays.php114310644editdlrm
Callback.php35660644editdlrm
DateTime.php29230644editdlrm
exceptions.php7750644editdlrm
FileInfo.php12910644editdlrm
FileSystem.php92900644editdlrm
Finder.php133660644editdlrm
Floats.php21200644editdlrm
Helpers.php25600644editdlrm
Html.php194890644editdlrm
Image.php241970644editdlrm
ImageColor.php16410644editdlrm
ImageType.php4210644editdlrm
Json.php22740644editdlrm
ObjectHelpers.php70120644editdlrm
Paginator.php44890644editdlrm
Random.php10990644editdlrm
Reflection.php85720644editdlrm
ReflectionMethod.php8120644editdlrm
Strings.php221400644editdlrm
Type.php65080644editdlrm
Validators.php106640644editdlrm
Edit: /home/techb158/dev.balacoffee.com/vendor/nette/utils/src/Utils/Helpers.php (2560B)
$max) { throw new Nette\InvalidArgumentException("Minimum ($min) is not less than maximum ($max)."); } return min(max($value, $min), $max); } /** * Looks for a string from possibilities that is most similar to value, but not the same (for 8-bit encoding). * @param string[] $possibilities */ public static function getSuggestion(array $possibilities, string $value): ?string { $best = null; $min = (strlen($value) / 4 + 1) * 10 + .1; foreach (array_unique($possibilities) as $item) { if ($item !== $value && ($len = levenshtein($item, $value, 10, 11, 10)) < $min) { $min = $len; $best = $item; } } return $best; } /** * Compares two values in the same way that PHP does. Recognizes operators: >, >=, <, <=, =, ==, ===, !=, !==, <> */ public static function compare(mixed $left, string $operator, mixed $right): bool { return match ($operator) { '>' => $left > $right, '>=' => $left >= $right, '<' => $left < $right, '<=' => $left <= $right, '=', '==' => $left == $right, '===' => $left === $right, '!=', '<>' => $left != $right, '!==' => $left !== $right, default => throw new Nette\InvalidArgumentException("Unknown operator '$operator'"), }; } }