src/Koldy/Config.php
public function getArrayItem(string $key, string $subKey, $defaultValue = null)
    {
        $expectedArray = $this->get($key, []);

        if (!is_array($expectedArray)) {
            $type = gettype($expectedArray);
            throw new ConfigException("Trying to fetch array from config={$this->name()} under key={$key}, but got '{$type}' instead");
        }

        return array_key_exists($subKey, $expectedArray) ? $expectedArray[$subKey] : $defaultValue;
    }
public function getArrayItem(string $key, string $subKey, $defaultValue = null)
    {
        $expectedArray = $this->get($key, []);

        if (!is_array($expectedArray)) {
            $type = gettype($expectedArray);
            throw new ConfigException("Trying to fetch array from config={$this->name()} under key={$key}, but got '{$type}' instead");
        }

        return array_key_exists($subKey, $expectedArray) ? $expectedArray[$subKey] : $defaultValue;
    }
public function getArrayItem ( string $ key , string $ subKey , $ defaultValue = null ) { $ expectedArray = $ this -> get ( $ key , [ ] ) ; if ( ! is_array ( $ expectedArray ) ) { $ type = gettype ( $ expectedArray ) ; throw new ConfigException ( "Trying to fetch array from config={$this->name()} under key={$key}, but got '{$type}' instead" ) ; } return array_key_exists ( $ subKey , $ expectedArray ) ? $ expectedArray [ $ subKey ] : $ defaultValue ; }
If targeted key in first level is array, then you can use this to fetch the key from that array

@param string $key
@param string $subKey
@param mixed|null $defaultValue

@return mixed
@throws ConfigException
@throws Exception
If targeted key in first level is array then you can use this to fetch the key from that array