Completed
Pull Request — 2.x (#28)
by Hari
01:57
created

TranslatorLocatorFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A newInstance() 0 16 1
1
<?php
2
/**
3
 *
4
 * This file is part of the Aura Project for PHP.
5
 *
6
 * @package Aura.Intl
7
 *
8
 * @license http://opensource.org/licenses/MIT MIT
9
 *
10
 */
11
namespace Aura\Intl;
12
13
/**
14
 *
15
 * Formatter Interface
16
 *
17
 * @package Aura.Intl
18
 *
19
 */
20
class TranslatorLocatorFactory
21
{
22 1
    public function newInstance()
23
    {
24 1
        return new TranslatorLocator(
25 1
            new PackageLocator,
26 1
            new FormatterLocator([
27
                'basic' => function () {
28
                    return new \Aura\Intl\BasicFormatter;
29 1
                },
30 1
                'intl'  => function () {
31
                    return new \Aura\Intl\IntlFormatter;
32 1
                },
33
            ]),
34 1
            new TranslatorFactory,
35 1
            'en_US'
36
        );
37
    }
38
}
39