Completed
Push — master ( 480535...7e0bd3 )
by Anton
12s
created

Translator::initInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link      https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Proxy;
12
13
use Bluz\Translator\Translator as Instance;
14
15
/**
16
 * Proxy to Translator
17
 *
18
 * Example of usage
19
 * <code>
20
 *     use Bluz\Proxy\Translator;
21
 *
22
 *     echo Translator::translate('message id');
23
 * </code>
24
 *
25
 * @package  Bluz\Proxy
26
 * @author   Anton Shevchuk
27
 *
28
 * @method   static Instance getInstance()
29
 *
30
 * @method   static string translate($message, ...$text)
31
 * @see      Instance::translate()
32
 *
33
 * @method   static string translatePlural($singular, $plural, $number, ...$text)
34
 * @see      Instance::translatePlural()
35
 */
36
final class Translator
37
{
38
    use ProxyTrait;
39
40
    /**
41
     * Init instance
42
     *
43
     * @return Instance
44
     */
45 1
    protected static function initInstance()
46
    {
47 1
        $instance = new Instance();
48 1
        $instance->setOptions(Config::getData('translator'));
49 1
        return $instance;
50
    }
51
}
52