Passed
Push — master ( d5c6e8...acf3eb )
by Jean-Christophe
06:08
created

Framework::hasAdmin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
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 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This class gives access to useful methods or objects of the framework.
5
 * Ubiquity\core
6
 * This class is part of Ubiquity
7
 * @author jcheron <[email protected]>
8
 * @version 1.0.2
9
 *
10
 */
11
namespace Ubiquity\core;
12
13
use Ubiquity\controllers\Startup;
14
use Ubiquity\controllers\Router;
15
use Ubiquity\utils\http\URequest;
16
use Ubiquity\utils\http\USession;
17
use Ubiquity\utils\http\UCookie;
18
use Ubiquity\orm\OrmUtils;
19
use Ubiquity\translation\TranslatorManager;
20
use Ubiquity\contents\normalizers\NormalizersManager;
21
use Ubiquity\assets\AssetsManager;
22
23
class Framework {
24
	public const version = '2.0.11+';
25
26 2
	public static function getVersion() {
27 2
		return self::version;
28
	}
29
30 2
	public static function getController() {
31 2
		return Startup::getController ();
32
	}
33
34 2
	public static function getAction() {
35 2
		return Startup::getAction ();
36
	}
37
38 2
	public static function getUrl() {
39 2
		return \implode ( "/", Startup::$urlParts );
40
	}
41
42
	public static function getRouter() {
43
		return new Router ();
44
	}
45
46
	public static function getORM() {
47
		return new OrmUtils ();
48
	}
49
50
	public static function getRequest() {
51
		return new URequest ();
52
	}
53
54
	public static function getSession() {
55
		return new USession ();
56
	}
57
58
	public static function getCookies() {
59
		return new UCookie ();
60
	}
61
62
	public static function getTranslator() {
63
		return new TranslatorManager ();
64
	}
65
66
	public static function getNormalizer() {
67
		return new NormalizersManager ();
68
	}
69
70 2
	public static function hasAdmin() {
71 2
		return \class_exists ( "controllers\Admin" );
72
	}
73
74
	public static function getAssets() {
75
		return new AssetsManager ();
76
	}
77
}
78
79