Configuration.php 783 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Aws\S3\UseArnRegion;
  3. use Aws;
  4. use Aws\S3\UseArnRegion\Exception\ConfigurationException;
  5. class Configuration implements ConfigurationInterface
  6. {
  7. private $useArnRegion;
  8. public function __construct($useArnRegion)
  9. {
  10. $this->useArnRegion = Aws\boolean_value($useArnRegion);
  11. if (is_null($this->useArnRegion)) {
  12. throw new ConfigurationException("'use_arn_region' config option"
  13. . " must be a boolean value.");
  14. }
  15. }
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function isUseArnRegion()
  20. {
  21. return $this->useArnRegion;
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function toArray()
  27. {
  28. return [
  29. 'use_arn_region' => $this->isUseArnRegion(),
  30. ];
  31. }
  32. }