Exception
11 months ago
Configuration.php
11 months ago
ConfigurationInterface.php
11 months ago
ConfigurationProvider.php
11 months ago
Configuration.php
38 lines
| 1 | <?php |
| 2 | namespace Aws\Endpoint\UseFipsEndpoint; |
| 3 | |
| 4 | use Aws; |
| 5 | use Aws\Endpoint\UseFipsEndpoint\Exception\ConfigurationException; |
| 6 | |
| 7 | class Configuration implements ConfigurationInterface |
| 8 | { |
| 9 | private $useFipsEndpoint; |
| 10 | |
| 11 | public function __construct($useFipsEndpoint) |
| 12 | { |
| 13 | $this->useFipsEndpoint = Aws\boolean_value($useFipsEndpoint); |
| 14 | if (is_null($this->useFipsEndpoint)) { |
| 15 | throw new ConfigurationException("'use_fips_endpoint' config option" |
| 16 | . " must be a boolean value."); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * {@inheritdoc} |
| 22 | */ |
| 23 | public function isUseFipsEndpoint() |
| 24 | { |
| 25 | return $this->useFipsEndpoint; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * {@inheritdoc} |
| 30 | */ |
| 31 | public function toArray() |
| 32 | { |
| 33 | return [ |
| 34 | 'use_fips_endpoint' => $this->isUseFipsEndpoint(), |
| 35 | ]; |
| 36 | } |
| 37 | } |
| 38 |