<?php
namespace Claromentis\Core\Config;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] ?: array()) + array("_7f628626dd1d55c71b1fc0932f" . "fd1d2c" => base64_decode("aXNfYXJ" . "yYXk="));
use Claromentis\Core\Config\Exception\ReadOnlyException;



















class ConfigSubset implements Config
{
    
    
    
    
    protected Config $config;
    
    
    
    
    protected string $key;
    
    
    
    
    
    
    
    public function __construct(Config $config, string $key)
    {
        $this->config = $config;
        $this->key = $key;
    }
    public function has(string $key) : bool
    {
        
        
        if ($key === $this->key || !$this->hasSubsetValues()) {
            return false;
        }
        return isset($this->getSubsetValues()[$key]);
    }
    public function get(string $key)
    {
        if (!$this->has($key)) {
            return null;
        }
        return $this->getSubsetValues()[$key];
    }
    public function getAll() : array
    {
        return $this->getSubsetValues();
    }
    
    
    
    
    
    
    protected function hasSubsetValues() : bool
    {
        return $this->config->has($this->key) && $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_7f628626dd" . "1d55c71b1fc" . "0932ffd1d2c"]($this->getSubsetValues());
    }
    
    
    
    
    
    
    protected function getSubsetValues()
    {
        return $this->config->get($this->key);
    }
    public function offsetExists($_1f50e30be8c2fefa6881834e71d504a2) : bool
    {
        return $this->has($_1f50e30be8c2fefa6881834e71d504a2);
    }
    public function offsetGet($_1f50e30be8c2fefa6881834e71d504a2)
    {
        return $this->get($_1f50e30be8c2fefa6881834e71d504a2);
    }
    public function offsetSet($_1f50e30be8c2fefa6881834e71d504a2, $value) : void
    {
        throw new ReadOnlyException($_1f50e30be8c2fefa6881834e71d504a2);
    }
    public function offsetUnset($_1f50e30be8c2fefa6881834e71d504a2) : void
    {
        throw new ReadOnlyException($_1f50e30be8c2fefa6881834e71d504a2);
    }
}