<?php
use Psr\Container\ContainerInterface;

return [
    Incoviba\Common\Define\Database::class => function(ContainerInterface $container) {
        return new Incoviba\Common\Implement\Database\MySQL(
            $container->has('DB_HOST') ? $container->get('DB_HOST') : 'db',
            $container->get('DB_DATABASE'),
            $container->get('DB_USER'),
            $container->get('DB_PASSWORD')
        );
    },
    Incoviba\Common\Define\Connection::class => function(ContainerInterface $container) {
        return new Incoviba\Common\Implement\Connection(
            $container->get(Incoviba\Common\Define\Database::class),
            $container->get(Incoviba\Common\Implement\Database\Query\Builder::class)
        );
    }
];
