Passed
Push — master ( 2f96fd...1abe95 )
by Jean-Christophe
06:03
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.1
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
22
class Framework {
23
	public const version = '2.0.11';
24
25 2
	public static function getController() {
26 2
		return Startup::getController ();
27
	}
28
29 2
	public static function getAction() {
30 2
		return Startup::getAction ();
31
	}
32
33 2
	public static function getUrl() {
34 2
		return \implode ( "/", Startup::$urlParts );
35
	}
36
37
	public static function getRouter() {
38
		return new Router ();
39
	}
40
41
	public static function getORM() {
42
		return new OrmUtils ();
43
	}
44
45
	public static function getRequest() {
46
		return new URequest ();
47
	}
48
49
	public static function getSession() {
50
		return new USession ();
51
	}
52
53
	public static function getCookies() {
54
		return new UCookie ();
55
	}
56
57
	public static function getTranslator() {
58
		return new TranslatorManager ();
59
	}
60
61
	public static function getNormalizer() {
62
		return new NormalizersManager ();
63
	}
64
65 2
	public static function hasAdmin() {
66 2
		return \class_exists ( "controllers\Admin" );
67
	}
68
}
69
70