BoolResult.php 744 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Gateway\Command\Result;
  7. use Magento\Payment\Gateway\Command\ResultInterface;
  8. /**
  9. * Container for boolean value that should be returned as command result.
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class BoolResult implements ResultInterface
  15. {
  16. /**
  17. * @var array
  18. */
  19. private $result;
  20. /**
  21. * Constructor
  22. *
  23. * @param bool $result
  24. */
  25. public function __construct($result = true)
  26. {
  27. $this->result = $result;
  28. }
  29. /**
  30. * Returns result interpretation
  31. *
  32. * @return mixed
  33. */
  34. public function get()
  35. {
  36. return (bool) $this->result;
  37. }
  38. }