Completed
Push — master ( 604a2f...9beb61 )
by Anton
10s
created

Router::initInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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