Completed
Push — master ( 3999cc...7004fd )
by Anton
04:02 queued 01:32
created

Translator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A initInstance() 0 7 1
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
     * @throws \Bluz\Common\Exception\ConfigurationException
45
     */
46
    private static function initInstance(): Instance
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
47
    {
48
        $instance = new Instance();
49
        $instance->setOptions(Config::get('translator'));
50
        $instance->init();
51
        return $instance;
52
    }
53
}
54