<?php

namespace modules\edgegateway\config;

use Exception;
use traits\module_config_variable;

class edgegateway_broker_url_c
{
    use module_config_variable;

    /**
     * @throws Exception
     */
    public function __construct()
    {
        $this->setupConfigVariable(
            'edgegateway',
            'broker_url',
            'string',
            false,
            null,
            'The internal HTTP URL used by PHP workers to reach the edge broker service.',
            'http://edge-broker:4300',
            false,
            trim((string)(getenv('EDGE_BROKER_URL') ?: '')) ?: 'http://edge-broker:4300'
        );
    }
}
