<?php
namespace Claromentis\Core\Config;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] ?: array()) + array("_7f628626dd1d55c71b1fc093" . "2ffd1d2c" => base64_decode("aXN" . "fYX" . "JyY" . "Xk="));
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["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_7f628626dd1d55" . "c71b1fc0932ffd1" . "d2c"]($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);
    }
}