Вход Регистрация
Файл: sngine-v2.8/Script/includes/libs/AWS/Aws/EndpointDiscovery/Configuration.php
Строк: 44
<?php
namespace AwsEndpointDiscovery;

class 
Configuration implements ConfigurationInterface
{
    private 
$cacheLimit;
    private 
$enabled;

    public function 
__construct($enabled$cacheLimit 1000)
    {
        
$this->cacheLimit filter_var($cacheLimitFILTER_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($enabledFILTER_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()
        ];
    }
}
Онлайн: 0
Реклама