Passed
Push — master ( 18ebd9...0d7dbd )
by Gabriel
01:56 queued 11s
created

Product::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace codingFive0\octadesk;
4
5
class Product extends Octadesk
6
{
7
8
    public function __construct($accToken)
9
    {
10
        $this->setAccesToken($accToken);
11
        parent::__construct();
12
    }
13
14
    public function findProducts(string $keywords = null, bool $onlyEnabledItems = true, int $page = 1)
15
    {
16
        $this->request(
17
            "GET",
18
            "products/search",
19
            [
20
                "keywords" => $keywords,
21
                "onlyEnabledItems" => $onlyEnabledItems,
22
                "page" => $page,
23
                "asSuggestion" => true
24
            ]
25
        );
26
27
        return $this;
28
    }
29
30
    public function createProduct()
31
    {
32
        $body = [
0 ignored issues
show
Unused Code introduced by
The assignment to $body is dead and can be removed.
Loading history...
33
            "id" => "string",
34
            "isEnabled" => true,
35
            "sku" => "string",
36
            "productGroup" => [
37
                "id" => "string",
38
                "name" => "string",
39
                "dateCreation" => "2020-04-30T17:40:26.236Z",
40
                "description" => "string",
41
                "isEnabled" => true,
42
                "fields" => [
43
                    "string"
44
                ],
45
                "products" => [
46
                    null
47
                ]
48
            ],
49
            "members" => [
50
                [
51
                    "code" => "string",
52
                    "name" => "string",
53
                    "value" => []
54
                ]
55
            ],
56
            "publicMembers" => [
57
                [
58
                    "code" => "string",
59
                    "name" => "string",
60
                    "value" => []
61
                ]
62
            ],
63
            "thumbUrl" => "string"
64
        ];
65
    }
66
}