public static function castInt($value): int
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException('Value could not be parsed to integer');
        }

        return (int)$value;
    }
public static function castInt($value): int
    {
        if ($value !== null && !is_scalar($value)) {
            throw new InvalidArgumentException('Value could not be parsed to integer');
        }

        return (int)$value;
    }
public static function castInt ( $ value ) : int { if ( $ value !== null && ! is_scalar ( $ value ) ) { throw new InvalidArgumentException ( 'Value could not be parsed to integer' ) ; } return ( int ) $ value ; }
Converts the representation of a number to its integer equivalent.

@param mixed $value the representation of a number

@return int the integer equivalent
Converts the representation of a number to its integer equivalent .