Throw an exception if <i>$value</i> is not a float or null.

@param mixed $value
@throws MWrongTypeException
494810
public static function mustBeNullableFloat($value)
    {
        if (is_float($value) === false && $value != null) {
            throw new MWrongTypeException('\$value', 'float|null', gettype($value));
        }
    }
692269
public function startsWith($value): bool
    {
        if ($this->isValidType($value) === false) {
            throw new MWrongTypeException("\$value", $this->getType(), $value);
        }

        if ($this->count() <= 0) {
            return false;
        }

        $lastValue = $this->list[0];

        return ($lastValue == $value);
    }
37636
public function setValue($value) {
		if (is_array($value)) {
		    foreach ($value as $singleValue) {
		        if (!$this->isValueValid($singleValue)) {
		            throw new \Exception('Unexpected value type');
		        }
		    }
		} elseif (!$this->isValueValid($value)) {
		    throw new \Exception('Unexpected value type');
		}
		$this->value = $value;

		return $this;
	}
1257300
private function checkValueIsValidOrThrowException($value)
    {
        if (!\is_array($value) || 1 !== \count($value)) {
            throw new FilterErrorException(
                'Condition parsing failed for "'
                . var_export($value, true)
                . '", it should be something like: "isEqualTo" : "a value"'
            );
        }
    }
34764
public static function createFloat($value)
    {
        if ($value instanceof NumericTypeInterface) {
            return $value->asFloatType();
        }
        if (!is_numeric($value)) {
            throw new \InvalidArgumentException("'{$value}' is no valid numeric for FloatType");
        }
        
        if (self::getRequiredType() == self::TYPE_GMP) {
            return RationalTypeFactory::create($value);
        }
        
        return new FloatType($value);
    }
484764
protected function typecastValue($value, $type)
    {
        if (is_scalar($type)) {
            if (is_object($value) && method_exists($value, '__toString')) {
                $value = $value->__toString();
            }

            switch ($type) {
                case self::TYPE_INTEGER:
                    return (int)$value;
                case self::TYPE_FLOAT:
                    return (float)$value;
                case self::TYPE_BOOLEAN:
                    return (bool)$value;
                case self::TYPE_STRING:
                    return (string)$value;
                case self::TYPE_JSON:
                    return is_string($value) ? $value : json_encode($value);
                case self::TYPE_IMPLODE:
                    return is_string($value) ? $value : (string)implode($this->delimiter, $value);
                case self::TYPE_SERIALIZE:
                    return is_string($value) ? $value : serialize($value);
                default:
                    throw new InvalidParamException("Unsupported type '{$type}'");
            }
        }

        return call_user_func($type, $value);
    }
1011230
public function setCodeType($value)
    {
        if (in_array($value, $this->codeTypeList)) {
            $this->codeType = $value;
        } else {
            throw new \Exception('Wrong code type "' . $value . '". Accepted : numeric, alpha or alphanumeric');
        }

        return $this;
    }
37544
public static function mustBeNullableString($value)
    {
        if (is_string($value) === false && $value != null) {
            throw new MWrongTypeException('\$value', 'string|null', gettype($value));
        }
    }
322106
public function unserialize($value)
    {
        if ($value === null || is_scalar($value)) {
            $this->str = unserialize($value);
        } else {
            throw new \InvalidArgumentException(sprintf('HString cannot unserialize a %s', Helper::getType($value)));
        }
    }
1214044
protected function assertValue($value)
    {
        $utf8 = mb_convert_encoding($value, 'UTF-8', 'auto');

        if (!preg_match_all(static::STRICT_VALUE_PATTERN, $utf8, $matches)) {
            $message = sprintf('Could not serialize LTSV value = %s. It contains an illegal character.', $value);

            throw new \RuntimeException($message);
        }
    }
37492
protected function convertType(string $value)
    {
        $val = \mb_strtolower($value);
        if ($val === 'true') {
            return true;
        } elseif ($val === 'false') {
            return false;
        } elseif ($val === 'null') {
            return null;
        } elseif (\mb_strpos($val, '.') !== false && \is_numeric($val)) {
            return (float) $val;
        } elseif (\is_numeric($val)) {
            return (int) $val;
        }

        return $this->replaceVariables($value);
    }
293298
private function normalizeValue($value)
    {
        switch ($this->type) {
            case self::TYPE_STRING:
                return trim((string)$value);
            case self::TYPE_INT:
                return intval($value);
            case self::TYPE_FLOAT:
                return floatval($value);
        }

        throw new FilterException("Invalid filter value type \"{$this->type}\"");
    }
686241
protected function _checkType( $value )
	{
		switch( $value )
		{
			case MShop_Order_Item_Abstract::TYPE_REPEAT:
			case MShop_Order_Item_Abstract::TYPE_WEB:
			case MShop_Order_Item_Abstract::TYPE_PHONE:
				break;
			default:
				throw new MShop_Order_Exception( sprintf( 'Order type "%1$s" not within allowed range', $value ) );
		}
	}
1142207
protected function setValue($value)
    {
        if (! is_bool($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a boolean", static::prototype());
        }

        $this->value = $value;
    }
757941
public function setRawValue( $value )
	{
		if ( is_null( $value ) )
			$this->_value = CoreFuncs::$False;
		else
			$this->_value = $value;

		$this->_xmlType = null;
	}
27955
public function setValue($value)
    {
        if (!$this->isValid($value)) {
            throw new \UnexpectedValueException("Value '$value' is not part of the enum ".get_called_class());
        }
        $this->value = $value;
    }
1147946
public function validateValue($value)
    {
        if (!$value instanceof MoneyInterface) {
            throw new Exception\InvalidArgumentException(
                sprintf(
                    'Value of type "%s" is invalid for %s; must implement "%s"',
                    is_object($value) ? get_class($value) : gettype($value),
                    get_class($this),
                    MoneyInterface::class
                )
            );
        }
    }