Test Failed
Push — master ( ab7ef5...297658 )
by Jean-Christophe
04:09
created

Framework::diSemantic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 5
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * Ubiquity\core
5
 * This class is part of Ubiquity
6
 * @author jc
7
 * @version 1.0.3
8
 *
9
 */
10
namespace Ubiquity\core;
11
12
use Ubiquity\assets\AssetsManager;
13
use Ubiquity\contents\normalizers\NormalizersManager;
14
use Ubiquity\controllers\Router;
15
use Ubiquity\controllers\Startup;
16
use Ubiquity\orm\OrmUtils;
17
use Ubiquity\translation\TranslatorManager;
18
use Ubiquity\utils\http\UCookie;
19
use Ubiquity\utils\http\URequest;
20
use Ubiquity\utils\http\USession;
21
use Ubiquity\cache\CacheManager;
22
23
class Framework {
24
	public const version = '2.4.12';
25
26 4
	public static function getVersion(): string {
27 4
		return self::version;
28
	}
29
30 4
	public static function getController(): ?string {
31 4
		return Startup::getController ();
32
	}
33
34 5
	public static function getAction(): ?string {
35 5
		return Startup::getAction ();
36
	}
37
38 4
	public static function getUrl(): string {
39 4
		return \implode ( '/', Startup::$urlParts );
40
	}
41
42 1
	public static function getRouter(): Router {
43 1
		return new Router ();
44
	}
45
46 1
	public static function getORM(): OrmUtils {
47 1
		return new OrmUtils ();
48
	}
49
50 1
	public static function getRequest(): URequest {
51 1
		return new URequest ();
52
	}
53
54 2
	public static function getSession(): USession {
55 2
		return new USession ();
56
	}
57
58 1
	public static function getCookies(): UCookie {
59 1
		return new UCookie ();
60
	}
61
62 1
	public static function getTranslator(): TranslatorManager {
63 1
		return new TranslatorManager ();
64
	}
65
66 1
	public static function getNormalizer(): NormalizersManager {
67 1
		return new NormalizersManager ();
68
	}
69
70 4
	public static function hasAdmin(): bool {
71 4
		return \class_exists ( "controllers\Admin" );
72
	}
73
74 1
	public static function getAssets(): AssetsManager {
75 1
		return new AssetsManager ();
76
	}
77
78 3
	public static function getCacheSystem():string {
79 3
		return \get_class ( CacheManager::$cache );
80
	}
81
82 3
	public static function getAnnotationsEngine():string {
83 3
		return \get_class ( CacheManager::getAnnotationsEngineInstance () );
84
	}
85
}
86
87