PluginProbe
Media Cloud Sync / 1.2.5
Media Cloud Sync v1.2.5
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
media-cloud-sync / includes / sdk / s3 / Aws / EndpointDiscovery / Configuration.php

Configuration.php in Media Cloud Sync 1.2.5, at includes/sdk/s3/Aws/EndpointDiscovery/Configuration.php

40 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Dudlewebs\WPMCS\s3\Aws\EndpointDiscovery;
4
5 class Configuration implements ConfigurationInterface
6 {
7 private $cacheLimit;
8 private $enabled;
9 public function __construct($enabled, $cacheLimit = 1000)
10 {
11 $this->cacheLimit = \filter_var($cacheLimit, \FILTER_VALIDATE_INT);
12 if ($this->cacheLimit == \false || $this->cacheLimit < 1) {
13 throw new \InvalidArgumentException("'cache_limit' value must be a positive integer.");
14 }
15 // Unparsable $enabled flag errs on the side of disabling endpoint discovery
16 $this->enabled = \filter_var($enabled, \FILTER_VALIDATE_BOOLEAN);
17 }
18 /**
19 * {@inheritdoc}
20 */
21 public function isEnabled()
22 {
23 return $this->enabled;
24 }
25 /**
26 * {@inheritdoc}
27 */
28 public function getCacheLimit()
29 {
30 return $this->cacheLimit;
31 }
32 /**
33 * {@inheritdoc}
34 */
35 public function toArray()
36 {
37 return ['enabled' => $this->isEnabled(), 'cache_limit' => $this->getCacheLimit()];
38 }
39 }
40