Config::initInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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\ComponentException;
15
use Bluz\Config\Config as Instance;
16
17
/**
18
 * Proxy to Config
19
 *
20
 * Example of usage
21
 * <code>
22
 *     use Bluz\Proxy\Config;
23
 *
24
 *     if (!Config::get('db')) {
25
 *          throw new Exception('Configuration for `db` is missed');
26
 *     }
27
 * </code>
28
 *
29
 * @package  Bluz\Proxy
30
 * @author   Anton Shevchuk
31
 *
32
 * @method   static Instance getInstance()
33
 *
34
 * @method   static mixed get(...$keys)
35
 * @see      Instance::get()
36
 */
37
final class Config
38
{
39
    use ProxyTrait;
40
41
    /**
42
     * Init instance
43
     *
44
     * @throws ComponentException
45
     */
46
    private static function initInstance()
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...
47
    {
48
        throw new ComponentException('Class `Proxy\\Config` required external initialization');
49
    }
50
}
51