<?php

namespace App\DTO\Settings;

final class DatabaseDTO
{
    private string $host;
    private string $database;
    private string $username;
    private string $password;
    private string $prefix;
    private int $port;

    public function __construct(
        string $host,
        string $database,
        string $username,
        string $password,
        string $prefix,
        int $port
    ) {
        $this->host = $host;
        $this->database = $database;
        $this->username = $username;
        $this->password = $password;
        $this->prefix = $prefix;
        $this->port = $port;
    }

    public function getHost(): string
    {
        return $this->host;
    }

    public function getDatabase(): string
    {
        return $this->database;
    }

    public function getUsername(): string
    {
        return $this->username;
    }

    public function getPassword(): string
    {
        return $this->password;
    }

    public function getPrefix(): string
    {
        return $this->prefix;
    }

    public function getPort(): int
    {
        return $this->port;
    }

    public function toArray(): array
    {
        return [
            'host' => $this->host,
            'database' => $this->database,
            'username' => $this->username,
            'password' => $this->password,
            'prefix' => $this->prefix,
            'port' => $this->port,
        ];
    }
}
