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