Configuration.php 768 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Aws\Sts\RegionalEndpoints;
  3. class Configuration implements ConfigurationInterface
  4. {
  5. private $endpointsType;
  6. public function __construct($endpointsType)
  7. {
  8. $this->endpointsType = strtolower($endpointsType);
  9. if (!in_array($this->endpointsType, ['legacy', 'regional'])) {
  10. throw new \InvalidArgumentException(
  11. "Configuration parameter must either be 'legacy' or 'regional'."
  12. );
  13. }
  14. }
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function getEndpointsType()
  19. {
  20. return $this->endpointsType;
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function toArray()
  26. {
  27. return [
  28. 'endpoints_type' => $this->getEndpointsType()
  29. ];
  30. }
  31. }