PluginProbe ʕ •ᴥ•ʔ
Transferito: WP Migration / trunk
Transferito: WP Migration vtrunk
trunk 11.4.0 12.0.0 13.1.0 14.0.0 14.0.11 14.0.7 14.1.0 14.1.1 14.1.2 14.1.3 14.1.4
transferito / vendor / aws / aws-sdk-php / src / Endpoint / UseDualstackEndpoint / Configuration.php
transferito / vendor / aws / aws-sdk-php / src / Endpoint / UseDualstackEndpoint Last commit date
Exception 11 months ago Configuration.php 11 months ago ConfigurationInterface.php 11 months ago ConfigurationProvider.php 11 months ago
Configuration.php
42 lines
1 <?php
2 namespace Aws\Endpoint\UseDualstackEndpoint;
3
4 use Aws;
5 use Aws\Endpoint\UseDualstackEndpoint\Exception\ConfigurationException;
6
7 class Configuration implements ConfigurationInterface
8 {
9 private $useDualstackEndpoint;
10
11 public function __construct($useDualstackEndpoint, $region)
12 {
13 $this->useDualstackEndpoint = Aws\boolean_value($useDualstackEndpoint);
14 if (is_null($this->useDualstackEndpoint)) {
15 throw new ConfigurationException("'use_dual_stack_endpoint' config option"
16 . " must be a boolean value.");
17 }
18 if ($this->useDualstackEndpoint == true
19 && (strpos($region, "iso-") !== false || strpos($region, "-iso") !== false)
20 ) {
21 throw new ConfigurationException("Dual-stack is not supported in ISO regions"); }
22 }
23
24 /**
25 * {@inheritdoc}
26 */
27 public function isUseDualstackEndpoint()
28 {
29 return $this->useDualstackEndpoint;
30 }
31
32 /**
33 * {@inheritdoc}
34 */
35 public function toArray()
36 {
37 return [
38 'use_dual_stack_endpoint' => $this->isUseDualstackEndpoint(),
39 ];
40 }
41 }
42