socialbox-php/src/Socialbox/Classes/Configuration/DatabaseConfiguration.php

46 lines
950 B
PHP
Raw Normal View History

2024-10-24 15:15:14 -04:00
<?php
namespace Socialbox\Classes\Configuration;
class DatabaseConfiguration
{
private string $host;
private int $port;
private string $username;
private ?string $password;
private string $name;
public function __construct(array $data)
{
$this->host = (string)$data['host'];
$this->port = (int)$data['port'];
$this->username = (string)$data['username'];
$this->password = $data['password'] ? (string)$data['password'] : null;
$this->name = (string)$data['name'];
}
public function getHost(): string
{
return $this->host;
}
public function getPort(): int
{
return $this->port;
}
public function getUsername(): string
{
return $this->username;
}
public function getPassword(): ?string
{
return $this->password;
}
public function getName(): string
{
return $this->name;
}
}