<?php
namespace Claromentis\Core\Config;

$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_7f62862" . "6dd1d55c" . "71b1fc09" . "32ffd1d2" . "c" => base64_decode("aXNfYX" . "JyYXk="));
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["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_7f628626dd1d55c71b1fc09" . "32ffd1d2c"]($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);
    }
}