Issues (4138)

classes/integrations/class-woocommerce.php (13 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
namespace lsx_health_plan\classes;
3
4
/**
5
 * Contains the downloads functions post type
6
 *
7
 * @package lsx-health-plan
8
 */
9
class Woocommerce {
10
11
	/**
12
	 * Holds class instance
13
	 *
14
	 * @var      object \lsx_health_plan\classes\Woocommerce()
15
	 */
16
	protected static $instance = null;
17
18
	/**
19
	 * Holds class Account functionality
20
	 *
21
	 * @var      object \lsx_health_plan\classes\integrations\woocommerce\Admin()
22
	 */
23
	public $admin = null;
24
25
	/**
26
	 * Holds class Account functionality
27
	 *
28
	 * @var      object \lsx_health_plan\classes\integrations\woocommerce\Account()
29
	 */
30
	public $account = null;
31
32
	/**
33
	 * Holds class Plans functionality
34
	 *
35
	 * @var      object \lsx_health_plan\classes\integrations\woocommerce\Plans()
36
	 */
37
	public $plans = null;
38
39
	/**
40
	 * Holds class Login functionality
41
	 *
42
	 * @var      object \lsx_health_plan\classes\integrations\woocommerce\Login()
43
	 */
44
	public $login = null;
45
46
	/**
47
	 * Holds class Checkout functionality
48
	 *
49
	 * @var      object \lsx_health_plan\classes\integrations\woocommerce\Checkout()
50
	 */
51
	public $checkout = null;
52
53
	/**
54
	 * Constructor
55
	 */
56
	public function __construct() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
57
		$this->load_classes();
58
		$this->load_includes();
59
	}
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
60
61
	/**
62
	 * Return an instance of this class.
63
	 *
64
	 * @since 1.0.0
65
	 *
66
	 * @return    object \lsx_health_plan\classes\Woocommerce()    A single instance of this class.
67
	 */
68
	public static function get_instance() {
69
		// If the single instance hasn't been set, set it now.
70
		if ( null === self::$instance ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
71
			self::$instance = new self();
72
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
73
		return self::$instance;
74
	}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
75
76
	/**
77
	 * Loads the variable classes and the static classes.
78
	 */
79
	private function load_classes() {
80
		require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/woocommerce/class-admin.php';
81
		$this->admin = integrations\woocommerce\Admin::get_instance();
82
83
		require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/woocommerce/class-account.php';
84
		$this->account = integrations\woocommerce\Account::get_instance();
85
86
		require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/woocommerce/class-plans.php';
87
		$this->plans = integrations\woocommerce\Plans::get_instance();
88
89
		require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/woocommerce/class-login.php';
90
		$this->login = integrations\woocommerce\Login::get_instance();
91
92
		require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/woocommerce/class-checkout.php';
93
		$this->checkout = integrations\woocommerce\Checkout::get_instance();
94
	}
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
95
	/**
96
	 * Loads the includes
97
	 */
98
	private function load_includes() {
99
		require_once LSX_HEALTH_PLAN_PATH . 'includes/functions/woocommerce.php';
100
		require_once LSX_HEALTH_PLAN_PATH . 'includes/template-tags/woocommerce.php';
101
	}
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
102
}
103