public static function getValue(array $config, string $configPath, $default = null)
    {
        if ($configPath === '') {
            throw new InvalidArgumentException('Path must be not be empty string', 1496758719);
        }
        $path = str_getcsv($configPath, '.');
        // Loop through each part and extract its value
        $value = $config;
        foreach ($path as $segment) {
            if (array_key_exists($segment, $value)) {
                // Replace current value with child
                $value = $value[$segment];
            } else {
                if (\count(\func_get_args()) !== 2) {
                    return $default;
                }
                // Fail if key does not exist and no default value is provided
                throw new PathDoesNotExistException(sprintf('Path "%s" does not exist in array (tried reading)', $configPath), 1496758722);
            }
        }

        return $value;
    }