Passed
Push — master ( 59622b...014342 )
by Andrey
03:48
created

ScanSheet::getScanSheetDocuments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 10
rs 10
1
<?php
2
3
namespace Daaner\NovaPoshta\Models;
4
5
use Daaner\NovaPoshta\NovaPoshta;
6
use Daaner\NovaPoshta\Traits\Limit;
7
8
class ScanSheet extends NovaPoshta
9
{
10
    use Limit;
11
12
    protected $model = 'ScanSheet';
13
    protected $calledMethod;
14
    protected $methodProperties = null;
15
16
    /**
17
     * @see https://devcenter.novaposhta.ua/docs/services/55662bd3a0fe4f10086ec96e/operations/556c7734a0fe4f08e8f7ce31
18
     *
19
     * @return array
20
     */
21
    public function getScanSheetList()
22
    {
23
        $this->calledMethod = 'getScanSheetList';
24
25
        return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true);
26
    }
27
28
    /**
29
     * @see https://devcenter.novaposhta.ua/docs/services/55662bd3a0fe4f10086ec96e/operations/556c72d7a0fe4f08e8f7ce30
30
     *
31
     * @param string $ref
32
     * @return array
33
     */
34
    public function getScanSheet($ref)
35
    {
36
        $this->calledMethod = 'getScanSheet';
37
38
        $this->methodProperties = [];
39
        $this->methodProperties['Ref'] = $ref;
40
41
        return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true);
42
    }
43
44
    /**
45
     * @see https://devcenter.novaposhta.ua/docs/services/55662bd3a0fe4f10086ec96e/operations/556c6474a0fe4f08e8f7ce2e
46
     *
47
     * @param string||array $documents
0 ignored issues
show
Documentation Bug introduced by
The doc comment string||array at position 2 could not be parsed: Unknown type name '|' at position 2 in string||array.
Loading history...
48
     * @param string||null $ref
49
     * @return array
50
     */
51
    public function removeDocuments($documents, $ref = null)
52
    {
53
        $this->calledMethod = 'removeDocuments';
54
55
        $this->methodProperties = [];
56
        if ($ref) {
57
            $this->methodProperties['Ref'] = $ref;
58
        }
59
60
        if (is_array($documents) === false) {
61
            $documents = explode(' ', /** @scrutinizer ignore-type */ $documents);
62
        }
63
64
        $this->methodProperties['DocumentRefs'] = $documents;
65
66
        return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true);
67
    }
68
69
    /**
70
     * Не документировано
71
     *
72
     * @param string $ref
73
     * @return array
74
     */
75
    public function getScanSheetDocuments($ref)
76
    {
77
        $this->methodProperties = [];
78
        $this->getPage();
79
        $this->addLimit();
80
81
        $this->calledMethod = 'getScanSheetDocuments';
82
        $this->methodProperties['Ref'] = $ref;
83
84
        return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true);
85
    }
86
87
    /**
88
     * Не документировано
89
     *
90
     * @param string $ref
91
     * @return array
92
     */
93
    public function updateScanSheet($ref, $description)
94
    {
95
        $this->methodProperties = [];
96
97
        $this->calledMethod = 'updateScanSheet';
98
        $this->methodProperties['Ref'] = $ref;
99
        $this->methodProperties['Description'] = $description;
100
101
        return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true);
102
    }
103
}
104