TranslationProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
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