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

Response   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 8
c 1
b 0
f 1
dl 0
loc 53
ccs 6
cts 6
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getError() 0 3 1
A getBarcode() 0 3 1
A getMessage() 0 3 1
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