OrderResponse::getSuccess()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Models;
6
7
use DalliSDK\Models\Responses\Error;
8
use DalliSDK\Models\Responses\Success;
9
use DalliSDK\Traits\Fillable;
10
use JMS\Serializer\Annotation as JMS;
11
12
/**
13
 * Модель для мапинга ответа от https://api.dalli-service.com/v1/doc/createbasket
14
 *
15
 * @JMS\XmlRoot("order")
16
 */
17
class OrderResponse
18
{
19
    use Fillable;
20
21
    /**
22
     * Номер заявки в учетной системе ИМ (обязательный атрибут)
23
     *
24
     * @JMS\XmlAttribute()
25
     * @JMS\Type("string")
26
     * @JMS\SerializedName("number")
27
     */
28
    private string $number;
29
30
    /**
31
     * Штрих-код заказа в системе Dalli
32
     *
33
     * @JMS\XmlAttribute()
34
     * @JMS\Type("string")
35
     * @JMS\SerializedName("barcode")
36
     */
37
    private ?string $barcode = null;
38
39
40
    /**
41
     * Если запрос был успешный, то ответ мапится сюда
42
     *
43
     * @JMS\Type("DalliSDK\Models\Responses\Success")
44
     * @JMS\SerializedName("success")
45
     */
46
    private ?Success $success = null;
47
48
    /**
49
     * Если запрос был с ошибкой, то ответ мапится сюда
50
     *
51
     * @JMS\Type("array<DalliSDK\Models\Responses\Error>")
52
     * @JMS\XmlList(inline = true, entry = "error")
53
     * @var Error[]
54
     *
55
     */
56
    private ?array $errors = null;
57
58
    /**
59
     * @return string
60
     */
61 7
    public function getNumber(): string
62
    {
63 7
        return $this->number;
64
    }
65
66
    /**
67
     * @return string|null
68
     */
69 1
    public function getBarcode(): ?string
70
    {
71 1
        return $this->barcode;
72
    }
73
74
    /**
75
     * @return Success|null
76
     */
77 4
    public function getSuccess(): ?Success
78
    {
79 4
        return $this->success;
80
    }
81
82
    /**
83
     * @return array|null
84
     */
85 6
    public function getErrors(): ?array
86
    {
87 6
        return $this->errors;
88
    }
89
}
90