Beispiel #1
0
 /**
  * Convert an amount into a float.
  *
  * @var string|int|float $value The value to convert.
  * @throws InvalidRequestException on any validation failure.
  * @return float The amount converted to a float.
  */
 public function toFloat($value)
 {
     try {
         return Helper::toFloat($value);
     } catch (InvalidArgumentException $e) {
         // Throw old exception for legacy implementations.
         throw new InvalidRequestException($e->getMessage(), $e->getCode(), $e);
     }
 }
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Data type is not a valid decimal number
  */
 public function testToFloatFromBoolean()
 {
     $shortName = Helper::toFloat(false);
 }