Router::initInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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\Router\Router as Instance;
16
17
/**
18
 * Proxy to Router
19
 *
20
 * Example of usage
21
 * <code>
22
 *     use Bluz\Proxy\Router;
23
 *
24
 *     Router::getUrl('pages', 'index', ['alias' => 'about']); // for skeleton application is `/about.html`
25
 * </code>
26
 *
27
 * @package  Bluz\Proxy
28
 * @author   Anton Shevchuk
29
 *
30
 * @method   static Instance getInstance()
31
 *
32
 * @method   static string getBaseUrl()
33
 * @see      Instance::getBaseUrl()
34
 * @method   static void   setBaseUrl($baseUrl)
35
 * @see      Instance::setBaseUrl()
36
 *
37
 * @method   static string getUrl($module = 'index', $controller = 'index', $params = [])
38
 * @see      Instance::getUrl()
39
 *
40
 * @method   static string getFullUrl($module = 'index', $controller = 'index', $params = [])
41
 * @see      Instance::getFullUrl()
42
 *
43
 * @method   static string getCleanUri()
44
 * @see      Instance::getCleanUri()
45
 *
46
 * @method   static void process()
47
 * @see      Instance::process()
48
 *
49
 * @method   static string getDefaultModule()
50
 * @see      Instance::getDefaultModule()
51
 *
52
 * @method   static string getDefaultController()
53
 * @see      Instance::getDefaultController()
54
 *
55
 * @method   static string getErrorModule()
56
 * @see      Instance::getErrorModule()
57
 *
58
 * @method   static string getErrorController()
59
 * @see      Instance::getErrorController()
60
 */
61
final class Router
62
{
63
    use ProxyTrait;
64
65
    /**
66
     * Init instance
67
     *
68
     * @throws ComponentException
69
     */
70 1
    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...
71
    {
72 1
        throw new ComponentException("Class `Proxy\\Router` required external initialization");
73
    }
74
}
75