ConfigProvider::getDependencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 10
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * This File is Part of the Validus Translation package.
4
 *
5
 * @copyright (c) 2018 Validus <https://github.com/ValidusPHP/>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Validus\Translation;
14
15
use Symfony\Component\Translation\Translator;
16
use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
17
use Symfony\Contracts\Translation\TranslatorInterface;
18
use Validus\Translation\Middleware\TranslatorMiddleware;
19
use Validus\Translation\Middleware\TranslatorMiddlewareFactory;
20
21
class ConfigProvider
22
{
23
    /**
24
     * @return array
25
     */
26
    public function __invoke(): array
27
    {
28
        return [
29
            'dependencies' => $this->getDependencies(),
30
        ];
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function getDependencies(): array
37
    {
38
        return [
39
            'factories' => [
40
                Translator::class => TranslatorFactory::class,
41
                TranslatorMiddleware::class => TranslatorMiddlewareFactory::class,
42
            ],
43
            'aliases' => [
44
                TranslatorInterface::class => Translator::class,
45
                LegacyTranslatorInterface::class => Translator::class,
46
            ],
47
        ];
48
    }
49
}
50