game/_incl_data/class/Helper/Comparsion.php
2023-11-10 17:53:17 +02:00

23 lines
438 B
PHP

<?php
namespace Helper;
class Comparsion
{
/** Íå äà¸ò çíà÷åíèþ âûéòè çà ïðåäåëû.
* @param $value
* @param $minimum
* @param $maximum
* @return mixed
*/
public static function minimax($value, $minimum, $maximum): mixed
{
if ($value < $minimum) {
$value = $minimum;
}
if ($value > $maximum) {
$value = $maximum;
}
return $value;
}
}