# media-cloud-sync/1.2.8/includes/sdk/s3/Aws/EndpointDiscovery/Configuration.php

Media Cloud Sync, version 1.2.8. 40 lines.

- Page: https://pluginprobe.com/plugins/media-cloud-sync/1.2.8/code/includes/sdk/s3/Aws/EndpointDiscovery/Configuration.php
- Raw: https://pluginprobe.com/plugins/media-cloud-sync/1.2.8/raw/includes/sdk/s3/Aws/EndpointDiscovery/Configuration.php
- Modified: 2024-10-27T10:40:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/media-cloud-sync/1.2.8/code/includes/sdk/s3/Aws/EndpointDiscovery/Configuration.php#L10-L20`.

```php
<?php

namespace Dudlewebs\WPMCS\s3\Aws\EndpointDiscovery;

class Configuration implements ConfigurationInterface
{
    private $cacheLimit;
    private $enabled;
    public function __construct($enabled, $cacheLimit = 1000)
    {
        $this->cacheLimit = \filter_var($cacheLimit, \FILTER_VALIDATE_INT);
        if ($this->cacheLimit == \false || $this->cacheLimit < 1) {
            throw new \InvalidArgumentException("'cache_limit' value must be a positive integer.");
        }
        // Unparsable $enabled flag errs on the side of disabling endpoint discovery
        $this->enabled = \filter_var($enabled, \FILTER_VALIDATE_BOOLEAN);
    }
    /**
     * {@inheritdoc}
     */
    public function isEnabled()
    {
        return $this->enabled;
    }
    /**
     * {@inheritdoc}
     */
    public function getCacheLimit()
    {
        return $this->cacheLimit;
    }
    /**
     * {@inheritdoc}
     */
    public function toArray()
    {
        return ['enabled' => $this->isEnabled(), 'cache_limit' => $this->getCacheLimit()];
    }
}

```
