TranslationProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 10
ccs 5
cts 5
cp 1
crap 1
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Translation;
6
7
use Pimple\Container;
8
use Pimple\ServiceProviderInterface;
9
10
final class TranslationProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @param Container $container
14
     */
15
    public function register(Container $container)
16
    {
17 1
        $container['translator.providers'] = function () {
18 1
            return [];
19
        };
20
21 1
        $container['translator'] = function () use ($container) {
22 1
            return new Translator($container['translator.providers'], $container['logger'] ?? null);
23
        };
24 1
    }
25
}
26