NumberValue.php 552 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Aws\DynamoDb;
  3. /**
  4. * Special object to represent a DynamoDB Number (N) value.
  5. */
  6. class NumberValue implements \JsonSerializable
  7. {
  8. /** @var string Number value. */
  9. private $value;
  10. /**
  11. * @param string|int|float $value A number value.
  12. */
  13. public function __construct($value)
  14. {
  15. $this->value = (string) $value;
  16. }
  17. #[\ReturnTypeWillChange]
  18. public function jsonSerialize()
  19. {
  20. return $this->value;
  21. }
  22. public function __toString()
  23. {
  24. return $this->value;
  25. }
  26. }