Passed
Push — main ( ed4b4c...986270 )
by Aleksandr
09:15
created

Response::getError()   A

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 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
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\Responses;
6
7
use DalliSDK\Traits\Fillable;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Модель для ответа на запросы, сюда мапятся стандартные ответы
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/cancelOrder
14
 * @JMS\XmlRoot("response")
15
 */
16
class Response
17
{
18
    use Fillable;
19
20
    /**
21
     * Флаг наличия ошибки
22
     *
23
     * @JMS\XmlAttribute()
24
     * @JMS\Type("string")
25
     * @JMS\SerializedName("error")
26
     */
27
    private string $error;
28
29
    /**
30
     * Код ошибки
31
     *
32
     * @JMS\XmlAttribute()
33
     * @JMS\Type("string")
34
     * @JMS\SerializedName("barcode")
35
     */
36
    private ?string $barcode = null;
37
38
    /**
39
     * Сообщение об ошибке
40
     *
41
     * @JMS\XmlAttribute()
42
     * @JMS\Type("string")
43
     * @JMS\SerializedName("message")
44
     */
45
    private string $message;
46
47
    /**
48
     * @return bool
49
     */
50 2
    public function getError(): bool
51
    {
52 2
        return (bool)$this->error;
53
    }
54
55
    /**
56
     * @return ?string
57
     */
58 2
    public function getBarcode(): ?string
59
    {
60 2
        return $this->barcode;
61
    }
62
63
    /**
64
     * @return ?string
65
     */
66 2
    public function getMessage(): ?string
67
    {
68 2
        return $this->message;
69
    }
70
}
71