StaticAvailabilityChecker.php 693 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\InstantPurchase\PaymentMethodIntegration;
  7. /**
  8. * Availability checker with predefined result.
  9. *
  10. * @api
  11. * @since 100.2.0
  12. */
  13. class StaticAvailabilityChecker implements AvailabilityCheckerInterface
  14. {
  15. /**
  16. * @var bool
  17. */
  18. private $value;
  19. /**
  20. * AlwaysAvailable constructor.
  21. * @param bool $value
  22. */
  23. public function __construct(bool $value = true)
  24. {
  25. $this->value = $value;
  26. }
  27. /**
  28. * @inheritdoc
  29. * @since 100.2.0
  30. */
  31. public function isAvailable(): bool
  32. {
  33. return $this->value;
  34. }
  35. }