<?php

namespace Slovocast\Infrastructure\Configuration;

use League\Config\ConfigurationInterface;
use League\Config\Configuration;
use Nette\Schema\Expect;

class DatabaseConfiguration
{
    public static function getConfig(): ConfigurationInterface
    {
        return new Configuration([
            'database' => Expect::structure([
                'driver' => Expect::anyOf('mysql', 'sqlite')->required(),
                'host' => Expect::string()->default('localhost'),
                'post' => Expect::int()->min(1)->max(65535),
                'database' => Expect::string()->required(),
                'username' => Expect::string()->required(),
                'password' => Expect::string()->nullable()
            ])
        ]);
    }
    
}
