League\CommonMark\Util\Configuration::getConfigByPath PHP Method

getConfigByPath() protected method

protected getConfigByPath ( string $keyPath, string | null $default = null ) : mixed
$keyPath string
$default string | null
return mixed
    protected function getConfigByPath($keyPath, $default = null)
    {
        $keyArr = explode('/', $keyPath);
        $data = $this->config;
        foreach ($keyArr as $k) {
            if (!is_array($data) || !isset($data[$k])) {
                return $default;
            }
            $data = $data[$k];
        }
        return $data;
    }