Query::init()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
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