Passed
Pull Request — master (#4)
by Warwick
02:43
created

Admin   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
c 2
b 0
f 0
dl 0
loc 53
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A get_instance() 0 6 2
A load_classes() 0 5 1
A __construct() 0 2 1
1
<?php
2
/**
3
 * LSX_Sharing_Admin
4
 *
5
 * @package lsx-sharing
6
 */
7
8
namespace lsx\sharing\classes;
9
10
/**
11
 * LSX Sharing admin class.
12
 *
13
 * @package lsx-sharing
14
 */
15
class Admin {
16
17
	/**
18
	 * Holds class instance.
19
	 *
20
	 * @var      object \lsx\sharing\classes\Admin()
21
	 */
22
	protected static $instance = null;
23
24
	/**
25
	 * Holds Settings Theme Instance
26
	 *
27
	 * @var object \lsx\sharing\classes\admin\Settings_Theme()
28
	 */
29
	public $settings_theme = false;
30
31
	/**
32
	 * Holds Settings Instance
33
	 *
34
	 * @var      object \lsx\sharing\classes\admin\Settings()
35
	 */
36
	public $settings = false;
37
38
	/**
39
	 * Constructor.
40
	 */
41
	public function __construct() {
42
		$this->load_classes();
43
	}
44
45
	/**
46
	 * Return an instance of this class.
47
	 *
48
	 * @since 1.0.0
49
	 *
50
	 * @return    object \lsx\sharing\Admin()    A single instance of this class.
51
	 */
52
	public static function get_instance() {
53
		// If the single instance hasn't been set, set it now.
54
		if ( null === self::$instance ) {
55
			self::$instance = new self();
56
		}
57
		return self::$instance;
58
	}
59
60
	/**
61
	 * Loads the plugin functions.
62
	 */
63
	private function load_classes() {
64
		require_once LSX_SHARING_PATH . '/classes/admin/class-settings-theme.php';
65
		$this->settings_theme = \lsx\sharing\classes\admin\Settings_Theme::get_instance();
66
		require_once LSX_SHARING_PATH . '/classes/admin/class-settings.php';
67
		$this->settings = \lsx\sharing\classes\admin\Settings::get_instance();
68
	}
69
}
70