Passed
Branch master (0d8fc3)
by Tomáš
12:26
created

DefaultBranch::getOpeningFriday()   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 Inspirum\Balikobot\Model\Branch;
6
7
use Inspirum\Arrayable\BaseModel;
8
9
/**
10
 * @extends \Inspirum\Arrayable\BaseModel<string,mixed>
11
 */
12
final class DefaultBranch extends BaseModel implements Branch
13
{
14 162
    public function __construct(
15
        private string $carrier,
16
        private ?string $service,
17
        private string $branchId,
18
        private ?string $id,
19
        private ?string $uid,
20
        private string $type,
21
        private string $name,
22
        private string $city,
23
        private string $street,
24
        private string $zip,
25
        private ?string $country = null,
26
        private ?string $cityPart = null,
27
        private ?string $district = null,
28
        private ?string $region = null,
29
        private ?string $currency = null,
30
        private ?string $photoSmall = null,
31
        private ?string $photoBig = null,
32
        private ?string $url = null,
33
        private ?float $latitude = null,
34
        private ?float $longitude = null,
35
        private ?string $directionsGlobal = null,
36
        private ?string $directionsCar = null,
37
        private ?string $directionsPublic = null,
38
        private ?bool $wheelchairAccessible = null,
39
        private ?bool $claimAssistant = null,
40
        private ?bool $dressingRoom = null,
41
        private ?string $openingMonday = null,
42
        private ?string $openingTuesday = null,
43
        private ?string $openingWednesday = null,
44
        private ?string $openingThursday = null,
45
        private ?string $openingFriday = null,
46
        private ?string $openingSaturday = null,
47
        private ?string $openingSunday = null,
48
        private ?float $maxWeight = null
49
    ) {
50
    }
51
52 3
    public function getCarrier(): string
53
    {
54 3
        return $this->carrier;
55
    }
56
57 3
    public function getService(): ?string
58
    {
59 3
        return $this->service;
60
    }
61
62 2
    public function getBranchId(): string
63
    {
64 2
        return $this->branchId;
65
    }
66
67 5
    public function getId(): ?string
68
    {
69 5
        return $this->id;
70
    }
71
72 1
    public function getUid(): ?string
73
    {
74 1
        return $this->uid;
75
    }
76
77 4
    public function getType(): string
78
    {
79 4
        return $this->type;
80
    }
81
82 4
    public function getName(): string
83
    {
84 4
        return $this->name;
85
    }
86
87 3
    public function getCity(): string
88
    {
89 3
        return $this->city;
90
    }
91
92 5
    public function getStreet(): string
93
    {
94 5
        return $this->street;
95
    }
96
97 3
    public function getZip(): string
98
    {
99 3
        return $this->zip;
100
    }
101
102 32
    public function getCountry(): ?string
103
    {
104 32
        return $this->country;
105
    }
106
107 3
    public function getCityPart(): ?string
108
    {
109 3
        return $this->cityPart;
110
    }
111
112 3
    public function getDistrict(): ?string
113
    {
114 3
        return $this->district;
115
    }
116
117 3
    public function getRegion(): ?string
118
    {
119 3
        return $this->region;
120
    }
121
122 3
    public function getCurrency(): ?string
123
    {
124 3
        return $this->currency;
125
    }
126
127 3
    public function getPhotoSmall(): ?string
128
    {
129 3
        return $this->photoSmall;
130
    }
131
132 3
    public function getPhotoBig(): ?string
133
    {
134 3
        return $this->photoBig;
135
    }
136
137 3
    public function getUrl(): ?string
138
    {
139 3
        return $this->url;
140
    }
141
142 3
    public function getLatitude(): ?float
143
    {
144 3
        return $this->latitude;
145
    }
146
147 3
    public function getLongitude(): ?float
148
    {
149 3
        return $this->longitude;
150
    }
151
152 3
    public function getDirectionsGlobal(): ?string
153
    {
154 3
        return $this->directionsGlobal;
155
    }
156
157 3
    public function getDirectionsCar(): ?string
158
    {
159 3
        return $this->directionsCar;
160
    }
161
162 3
    public function getDirectionsPublic(): ?string
163
    {
164 3
        return $this->directionsPublic;
165
    }
166
167 3
    public function getWheelchairAccessible(): ?bool
168
    {
169 3
        return $this->wheelchairAccessible;
170
    }
171
172 3
    public function getClaimAssistant(): ?bool
173
    {
174 3
        return $this->claimAssistant;
175
    }
176
177 3
    public function getDressingRoom(): ?bool
178
    {
179 3
        return $this->dressingRoom;
180
    }
181
182 3
    public function getOpeningMonday(): ?string
183
    {
184 3
        return $this->openingMonday;
185
    }
186
187 3
    public function getOpeningTuesday(): ?string
188
    {
189 3
        return $this->openingTuesday;
190
    }
191
192 3
    public function getOpeningWednesday(): ?string
193
    {
194 3
        return $this->openingWednesday;
195
    }
196
197 3
    public function getOpeningThursday(): ?string
198
    {
199 3
        return $this->openingThursday;
200
    }
201
202 3
    public function getOpeningFriday(): ?string
203
    {
204 3
        return $this->openingFriday;
205
    }
206
207 3
    public function getOpeningSaturday(): ?string
208
    {
209 3
        return $this->openingSaturday;
210
    }
211
212 3
    public function getOpeningSunday(): ?string
213
    {
214 3
        return $this->openingSunday;
215
    }
216
217 3
    public function getMaxWeight(): ?float
218
    {
219 3
        return $this->maxWeight;
220
    }
221
222
    /** @inheritDoc */
223 1
    public function __toArray(): array
224
    {
225
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('carrier' =...d, 'uid' => $this->uid) returns the type array<string,null|string> which is incompatible with the return type mandated by Inspirum\Arrayable\BaseModel::__toArray() of Inspirum\Arrayable\TValue[].

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
226 1
            'carrier'  => $this->carrier,
227 1
            'service'  => $this->service,
228 1
            'branchId' => $this->branchId,
229 1
            'id'       => $this->id,
230 1
            'uid'      => $this->uid,
231
            // TODO:
232
        ];
233
    }
234
}
235