Lines Matching defs:targetValue
74 public static function toIntegerOrDefaultIfNull($targetValue, $default): int
76 if ($targetValue === null) {
79 return self::toInteger($targetValue);
87 public static function toInteger($targetValue, string $roundDirection = self::FLOOR): int
91 if (is_int($targetValue)) {
92 return $targetValue;
94 if (!is_string($targetValue) && !is_float($targetValue)) {
95 $varExport = var_export($targetValue, true);
101 $float = self::toFloat($targetValue);
109 "$targetValue" !== "0"
111 throw new ExceptionBadArgument("The value ($targetValue) can not be cast to an integer.");
119 public static function toIntegerCeil($targetValue): int
122 return self::toInteger($targetValue, self::CEIL);