<?php
use Psr\Container\ContainerInterface;

return [
    Incoviba\Service\Login::class => function(ContainerInterface $container) {
        return new Incoviba\Service\Login(
            $container->get(Incoviba\Repository\Login::class),
            $container->get('COOKIE_NAME'),
            $container->get('MAX_LOGIN_HOURS'),
            $container->has('COOKIE_DOMAIN') ? $container->get('COOKIE_DOMAIN') : '',
            $container->has('COOKIE_PATH') ? $container->get('COOKIE_PATH') : ''
        );
    },
    Incoviba\Service\Money::class => function(ContainerInterface $container) {
        $mindicador = new Incoviba\Service\Money\MiIndicador(new GuzzleHttp\Client([
            'base_uri' => 'https://mindicador.cl/api/',
            'headers' => ['Accept' => 'application/json']
        ]));
        return (new Incoviba\Service\Money())->register('uf', $mindicador)
            ->register('ipc', $mindicador);
    },
];
