Completed
Pull Request — 2.x (#27)
by
unknown
02:09
created

TranslatorLocatorFactory::newInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1.0046

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
ccs 10
cts 12
cp 0.8333
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
crap 1.0046
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 1
            ]),
34 1
            new TranslatorFactory,
35
            'en_US'
36 1
        );
37
    }
38
}
39