TranslatorLocatorFactory::newInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
ccs 9
cts 9
cp 1
crap 1
rs 9.9666
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
    /**
23
     *
24
     * Returns a new TranslatorLocator.
25
     *
26
     * @return TranslatorLocator
27
     *
28
     */
29 1
    public function newInstance()
30
    {
31 1
        return new TranslatorLocator(
32 1
            new PackageLocator,
33 1
            new FormatterLocator([
34
                'basic' => function () {
35
                    return new \Aura\Intl\BasicFormatter;
36 1
                },
37 1
                'intl'  => function () {
38
                    return new \Aura\Intl\IntlFormatter;
39 1
                },
40
            ]),
41 1
            new TranslatorFactory,
42 1
            'en_US'
43
        );
44
    }
45
}
46