<?php
namespace Claromentis\Core\Dsn;

$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] ?: array()) + array("_70979d287fa2c98d21aa07834c" . "259a52" => base64_decode("c3Ryd" . "G9sb3" . "dlcg=" . "="), "_520f8a98" . "66328b5e6" . "acc19b765" . "4b3b61" => base64_decode("JXM" . "6JW" . "Q="), "_6596b8f6a4969f9a3f6a1b22b" . "90e9331" => base64_decode("c3B" . "yaW" . "50Z" . "g=="), "_49c6565477ee9f822b499a53e6" . "d2995f" => base64_decode("YXJyYX" . "lfa2V5" . "X2V4aX" . "N0cw=="), "_680cc2b8220e94c8c32b8b" . "c7c65519b4" => base64_decode("aXNfaW" . "50"), "_648575966037f731718de05" . "665363b35" => base64_decode("SG9zdCBtdXN0IGJlIG" . "Egbm9uLWVtcHR5IHN0" . "cmluZy4="), "_17b6736e737a52da358c1cd" . "82d48ecd9" => base64_decode("UG9ydCBtdXN0IGJlIG" . "51bGwgb3IgYSBub24t" . "bmVnYXRpdmUgaW50ZW" . "dlci4="));
use Webmozart\Assert\Assert;
class Dsn
{
    private string $protocol;
    private ?string $host = null;
    private ?int $port = null;
    private ?string $username = null;
    private ?string $password = null;
    private array $options = [];
    
    
    
    
    public function getProtocol() : string
    {
        return $this->protocol;
    }
    
    
    
    
    
    public function setProtocol(string $_21f5dd11309da4af2e51660e6f110a91) : self
    {
        $this->protocol = $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_70979d287fa2c98d21aa" . "07834c259a52"]($_21f5dd11309da4af2e51660e6f110a91);
        return $this;
    }
    
    
    
    
    
    
    
    public function getHost(bool $_6045d1b8e5cf6ecbf116bede90cd6a69 = false) : ?string
    {
        if (!$_6045d1b8e5cf6ecbf116bede90cd6a69 || $this->port === null) {
            return $this->host;
        }
        return $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_6596b8f6a4969f9" . "a3f6a1b22b90e933" . "1"]($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_520f8a9866328b5e6acc19b76" . "54b3b61"], $this->host, $this->port);
    }
    
    
    
    
    public function getPort() : ?int
    {
        return $this->port;
    }
    
    
    
    
    
    
    public function setHost(string $_99aecd7d25aa990307d2decfc5ef9490, ?int $_5fc941c6c18369354f2e1e56bc24eae4 = null) : self
    {
        Assert::stringNotEmpty($_99aecd7d25aa990307d2decfc5ef9490, $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_648575966037f731718de056" . "65363b35"]);
        Assert::true($_5fc941c6c18369354f2e1e56bc24eae4 === null || $_5fc941c6c18369354f2e1e56bc24eae4 >= 0 && $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_680cc2b8" . "220e94c8c" . "32b8bc7c6" . "5519b4"]($_5fc941c6c18369354f2e1e56bc24eae4), $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_17b6736e737a52da358c1cd8" . "2d48ecd9"]);
        $this->host = $_99aecd7d25aa990307d2decfc5ef9490;
        $this->port = $_5fc941c6c18369354f2e1e56bc24eae4;
        return $this;
    }
    
    
    
    
    public function getUsername() : ?string
    {
        return $this->username;
    }
    
    
    
    
    
    public function setUsername(?string $_28c85ce81fee6532980262893b6f2425) : self
    {
        $this->username = $_28c85ce81fee6532980262893b6f2425;
        return $this;
    }
    
    
    
    
    public function getPassword() : ?string
    {
        return $this->password;
    }
    
    
    
    
    
    public function setPassword(?string $_e0637eee905ebe3938c5da50e3db10d7) : self
    {
        $this->password = $_e0637eee905ebe3938c5da50e3db10d7;
        return $this;
    }
    
    
    
    
    public function getOptions() : array
    {
        return $this->options;
    }
    
    
    
    
    
    
    public function getOption(string $key, $default = null)
    {
        return $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_49c6565477ee9f822" . "b499a53e6d2995f"]($key, $this->options) ? $this->options[$key] : $default;
    }
    
    
    
    
    
    public function setOptions(array $options) : self
    {
        $this->options = $options;
        return $this;
    }
    
    
    
    
    
    
    public function addOption(string $key, $value) : self
    {
        $this->options[$key] = $value;
        return $this;
    }
}