Query   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 28
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setEndpoint() 0 6 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
24
        return $this;
25
    }
26
27
    public function init()
28
    {
29
        if (!static::$instance) {
30
            static::$instance = new static();
31
        }
32
33
        return static::$instance;
34
    }
35
}
36