Translator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 5
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A initInstance() 0 6 1
1
<?php
2
3
/**
4
 * Bluz Framework Component
5
 *
6
 * @copyright Bluz PHP Team
7
 * @link      https://github.com/bluzphp/framework
8
 */
9
10
declare(strict_types=1);
11
12
namespace Bluz\Proxy;
13
14
use Bluz\Common\Exception\ConfigurationException;
15
use Bluz\Translator\Translator as Instance;
16
17
/**
18
 * Proxy to Translator
19
 *
20
 * Example of usage
21
 * <code>
22
 *     use Bluz\Proxy\Translator;
23
 *
24
 *     echo Translator::translate('message id');
25
 * </code>
26
 *
27
 * @package  Bluz\Proxy
28
 * @author   Anton Shevchuk
29
 *
30
 * @method   static Instance getInstance()
31
 *
32
 * @method   static string translate($message, ...$text)
33
 * @see      Instance::translate()
34
 *
35
 * @method   static string translatePlural($singular, $plural, $number, ...$text)
36
 * @see      Instance::translatePlural()
37
 */
38
final class Translator
39
{
40
    use ProxyTrait;
41
42
    /**
43
     * Init instance
44
     *
45
     * @return Instance
46
     * @throws ConfigurationException
47
     */
48
    private static function initInstance(): Instance
0 ignored issues
show
Unused Code introduced by
The method initInstance() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
49
    {
50
        $instance = new Instance();
51
        $instance->setOptions(Config::get('translator'));
52
        $instance->init();
53
        return $instance;
54
    }
55
}
56