Completed
Push — master ( a88a56...6eb92f )
by CodexShaper
11:55
created

Query   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setEndpoint() 0 5 1
A init() 0 8 2
1
<?php
2
3
namespace Codexshaper\WooCommerce;
4
5
use Codexshaper\WooCommerce\Models\BaseMOdel;
6
use Codexshaper\WooCommerce\Traits\QueryBuilderTrait;
7
8
class Query extends BaseMOdel
9
{
10
	use QueryBuilderTrait;
11
12
	protected $endpoint;
13
	protected static $instance = null;
14
15
	public function __construct($endpoint = '')
16
	{
17
		$this->endpoint = $endpoint;
18
	}
19
20
	public function setEndpoint($endpoint)
21
	{
22
		$this->endpoint = $endpoint;
23
		return $this;
24
	}
25
26
	public function init()
27
	{
28
		if (!static::$instance) {
29
			static::$instance = new static();
30
		}
31
32
		return static::$instance;
33
	}
34
}