Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class ConfigCatProvider implements ProviderInterface |
||
12 | { |
||
13 | /** @var ConfigCatClient */ |
||
14 | private $client; |
||
15 | |||
16 | public function __construct(string $sdkKey, ConfigCache $cache = null, int $cacheTTL = 60, LoggerInterface $logger = null) |
||
17 | { |
||
18 | $options = []; |
||
19 | |||
20 | if ($cache) { |
||
21 | $options['cache'] = $cache; |
||
22 | $options['cache-refresh-interval'] = $cacheTTL; |
||
23 | } |
||
24 | |||
25 | if ($logger) { |
||
26 | $options['logger'] = $logger; |
||
27 | } |
||
28 | |||
29 | $this->client = new ConfigCatClient($sdkKey, $options); |
||
30 | } |
||
31 | |||
32 | |||
33 | public function isEnabled(string $key, string $identifier = null): bool |
||
42 | } |
||
43 | } |