<?php
use Psr\Container\ContainerInterface;

return [
    Incoviba\Common\Define\Database::class => function(ContainerInterface $container) {
        return new Incoviba\Common\Implement\Database\MySQL(
            $container->has('MYSQL_HOST') ? $container->get('MYSQL_HOST') : 'db',
            $container->get('MYSQL_DATABASE'),
            $container->get('MYSQL_USER'),
            $container->get('MYSQL_PASSWORD')
        );
    },
    Incoviba\Common\Define\Connection::class => function(ContainerInterface $container) {
        return new Incoviba\Common\Implement\Connection(
            $container->get(Incoviba\Common\Define\Database::class)
        );
    }
];
