Completed
Push — master ( 3f79ab...6d3a78 )
by Nazar
04:26
created

site_info::admin_site_info_settings_common()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 11
nc 2
nop 1
dl 0
loc 13
ccs 0
cts 12
cp 0
crap 12
rs 9.4285
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A site_info::admin_site_info_cancel_settings() 0 3 1
1
<?php
2
/**
3
 * @package    CleverStyle Framework
4
 * @subpackage System module
5
 * @category   modules
6
 * @author     Nazar Mokrynskyi <[email protected]>
7
 * @copyright  Copyright (c) 2015-2016, Nazar Mokrynskyi
8
 * @license    MIT License, see license.txt
9
 */
10
namespace cs\modules\System\api\Controller\admin;
11
use
12
	cs\Config;
13
14
trait site_info {
15
	protected static $site_info_options_keys = [
16
		'site_name',
17
		'url',
18
		'cookie_domain',
19
		'cookie_prefix',
20
		'timezone',
21
		'admin_email'
22
	];
23
	/**
24
	 * Get site info settings
25
	 */
26
	public static function admin_site_info_get_settings () {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
27
		$Config = Config::instance();
28
		return $Config->core(static::$site_info_options_keys) + [
29
			'applied' => $Config->cancel_available()
30
		];
31
	}
32
	/**
33
	 * Apply site info settings
34
	 *
35
	 * @param \cs\Request $Request
36
	 *
37
	 * @throws \cs\ExitException
38
	 */
39
	public static function admin_site_info_apply_settings ($Request) {
40
		static::admin_core_options_apply($Request, static::$site_info_options_keys);
41
	}
42
	/**
43
	 * Save site info settings
44
	 *
45
	 * @param \cs\Request $Request
46
	 *
47
	 * @throws \cs\ExitException
48
	 */
49
	public static function admin_site_info_save_settings ($Request) {
50
		static::admin_core_options_save($Request, static::$site_info_options_keys);
51
	}
52
	/**
53
	 * Cancel site info settings
54
	 *
55
	 * @throws \cs\ExitException
56
	 */
57
	public static function admin_site_info_cancel_settings () {
58
		static::admin_core_options_cancel();
59
	}
60
}
61