System   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 64
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A status() 0 6 1
A tool() 0 6 1
A tools() 0 6 1
A run() 0 6 1
1
<?php
2
3
namespace Codexshaper\WooCommerce\Models;
4
5
use Codexshaper\WooCommerce\Facades\Query;
6
use Codexshaper\WooCommerce\Traits\QueryBuilderTrait;
7
8
class System extends BaseModel
9
{
10
    use QueryBuilderTrait;
11
12
    protected $endpoint;
13
14
    /**
15
     * Retrieve all Items.
16
     *
17
     * @param array $options
18
     *
19
     * @return array
20
     */
21
    protected function status($options = [])
22
    {
23
        return Query::init()
24
            ->setEndpoint('system_status')
25
            ->all($options);
26
    }
27
28
    /**
29
     * Retrieve single tool.
30
     *
31
     * @param int   $id
32
     * @param array $options
33
     *
34
     * @return object
35
     */
36
    protected function tool($id, $options = [])
37
    {
38
        return Query::init()
39
            ->setEndpoint('system_status/tools')
40
            ->find($id, $options);
41
    }
42
43
    /**
44
     * Retrieve all tools.
45
     *
46
     * @param array $options
47
     *
48
     * @return array
49
     */
50
    protected function tools($options = [])
51
    {
52
        return Query::init()
53
            ->setEndpoint('system_status/tools')
54
            ->all($options);
55
    }
56
57
    /**
58
     * Run tool.
59
     *
60
     * @param int   $id
61
     * @param array $data
62
     *
63
     * @return object
64
     */
65
    protected function run($id, $data)
66
    {
67
        return Query::init()
68
            ->setEndpoint('system_status/tools')
69
            ->update($id, $data);
70
    }
71
}
72