RprtCli/app/dependencies.php

51 lines
1.7 KiB
PHP

<?php
use function DI\create;
use function DI\get;
use RprtCli\Commands\RprtCommand;
use RprtCli\Utils\Configuration\ConfigurationInterface;
use RprtCli\Utils\Configuration\ConfigurationService;
use RprtCli\Utils\CsvReport\CsvReport;
use RprtCli\Utils\CsvReport\CsvReportInterface;
use GuzzleHttp\Client;
use RprtCli\Utils\TimeTrackingServices\YoutrackInterface;
use RprtCli\Utils\TimeTrackingServices\YoutrackService;
# use Symfony\Component\Translation\Translator;
#use Symfony\Component\Translation\Loader\PoFileLoader;
return [
'config.file' => 'rprt.config.yml',
'config.path' => '~/.config/rprt-cli/',
'default_locale' => 'en',
// 'translator' => ['default_path' => '%kernel.project_dir%/translations'],
// 'guzzle' => create()->constructor(Client::class),
'guzzle' => get(Client::class),
ConfigurationInterface::class => get(ConfigurationService::class),
ConfigurationService::class => create()->constructor(
get('config.path'),
get('config.file')
),
'config.service' => get(ConfigurationInterface::class),
YoutrackInterface::class => get(YoutrackService::class),
YoutrackService::class => create()->constructor(
get('config.service'),
get('guzzle')
),
'youtrack.service' => get(YoutrackInterface::class),
// 'locale' => get('config.service')->method('get', 'en'),
// Translator::class => create()->constructor('sl')->method('addLoader', 'po', new PoFileLoader),
// 'translator' => get(Translator::class),
CsvReportInterface::class => get(CsvReport::class),
CsvReport::class => create()->constructor(
get('config.service')
),
'csv.report' => get(CsvReportInterface::class),
RprtCommand::class => create()->constructor(
get('csv.report'),
get('config.service'),
get('youtrack.service')
),
];