Issues (4138)

classes/integrations/class-facetwp.php (15 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 FacetWP {
10
11
	/**
12
	 * Holds class instance
13
	 *
14
	 * @var      object \lsx_health_plan\classes\FacetWP()
15
	 */
16
	protected static $instance = null;
17
18
	/**
19
	 * Holds the indexer filters for the workouts.
20
	 *
21
	 * @var      object \lsx_health_plan\classes\integrations\FacetWP\Workouts_Indexer()
22
	 */
23
	public $workouts = null;
24
25
	/**
26
	 * Constructor
27
	 */
28
	public function __construct() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
29
		$this->load_classes();
30
		add_filter( 'facetwp_facet_sources', array( $this, 'register_sources' ) );
31
	}
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...
32
33
	/**
34
	 * Return an instance of this class.
35
	 *
36
	 * @since 1.0.0
37
	 *
38
	 * @return    object \lsx_health_plan\classes\FacetWP()    A single instance of this class.
39
	 */
40
	public static function get_instance() {
41
		// If the single instance hasn't been set, set it now.
42
		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...
43
			self::$instance = new self();
44
		}
0 ignored issues
show
No blank line found after control structure
Loading history...
45
		return self::$instance;
46
	}
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...
47
48
	/**
49
	 * Loads the variable classes and the static classes.
50
	 */
51
	private function load_classes() {
52
		require_once LSX_HEALTH_PLAN_PATH . 'classes/integrations/facetwp/class-connected-plans.php';
53
		$this->connected_plans = integrations\facetwp\Connected_Plans::get_instance();
0 ignored issues
show
Bug Best Practice introduced by
The property connected_plans does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
54
	}
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...
55
56
	/**
57
	 * Registers the custom sources.
58
	 *
59
	 * @param array $sources
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
60
	 * @return array
61
	 */
62
	public function register_sources( $sources ) {
63
		$sources['lsx_health_plan'] = array(
64
			'label'   => __( 'LSX Health Plan', 'lsx-health-plan' ),
65
			'choices' => array(
66
				'lsx_hp/connected_plans' => 'Connected Plans',
67
			),
68
		);
69
70
		return $sources;
71
	}
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...
72
}
73