• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pgrimaud / instagram-user-feed / 7367308820

31 Dec 2023 12:41AM UTC coverage: 92.348%. Remained the same
7367308820

push

github

pgrimaud
Add support for Symfony 7

2124 of 2300 relevant lines covered (92.35%)

21.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.88
/src/Instagram/Model/Reels.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Instagram\Model;
6

7
class Reels
8
{
9
    /**
10
     * @var string
11
     */
12
    private $id;
13

14
    /**
15
     * @var string
16
     */
17
    private $shortCode;
18

19
    /**
20
     * @var string
21
     */
22
    private $link;
23

24
    /**
25
     * @var int
26
     */
27
    private $likes;
28

29
    /**
30
     * @var boolean
31
     */
32
    private $isLiked = false;
33

34
    /**
35
     * @var int
36
     */
37
    private $comments;
38

39
    /**
40
     * @var int
41
     */
42
    private $views;
43

44
    /**
45
     * @var int
46
     */
47
    private $plays;
48

49
    /**
50
     * @var float
51
     */
52
    private $duration;
53

54
    /**
55
     * @var int
56
     */
57
    private $height;
58

59
    /**
60
     * @var int
61
     */
62
    private $width;
63

64
    /**
65
     * @var boolean
66
     */
67
    private $hasAudio;
68

69
    /**
70
     * @var array
71
     */
72
    private $images = [];
73

74
    /**
75
     * @var array
76
     */
77
    private $videos = [];
78

79
    /**
80
     * @var string
81
     */
82
    private $caption;
83

84
    /**
85
     * @var mixed
86
     */
87
    private $location;
88

89
    /**
90
     * @var \DateTime
91
     */
92
    private $date;
93

94
    /**
95
     * @var array
96
     */
97
    private $hashtags = [];
98

99
    /**
100
     * @var array
101
     */
102
    private $userTags = [];
103

104
    /**
105
     * @var User
106
     */
107
    private $user;
108

109
    /**
110
     * @return string
111
     */
112
    public function getId(): string
113
    {
114
        return $this->id;
7✔
115
    }
116

117
    /**
118
     * @param string $id
119
     */
120
    public function setId(string $id): void
121
    {
122
        $this->id = $id;
14✔
123
    }
2✔
124

125
    /**
126
     * @return string
127
     */
128
    public function getShortCode(): string
129
    {
130
        return $this->shortCode;
7✔
131
    }
132

133
    /**
134
     * @param string $shortCode
135
     */
136
    public function setShortCode(string $shortCode): void
137
    {
138
        $this->shortCode = $shortCode;
14✔
139
    }
2✔
140

141
    /**
142
     * @return string
143
     */
144
    public function getLink(): string
145
    {
146
        return $this->link;
7✔
147
    }
148

149
    /**
150
     * @param string $link
151
     */
152
    public function setLink(string $link): void
153
    {
154
        $this->link = $link;
14✔
155
    }
2✔
156

157
    /**
158
     * @return int
159
     */
160
    public function getLikes(): int
161
    {
162
        return $this->likes;
7✔
163
    }
164

165
    /**
166
     * @param int $likes
167
     */
168
    public function setLikes(int $likes): void
169
    {
170
        $this->likes = $likes;
14✔
171
    }
2✔
172

173
    /**
174
     * @return bool
175
     */
176
    public function isLiked(): bool
177
    {
178
        return $this->isLiked;
7✔
179
    }
180

181
    /**
182
     * @param bool $isLiked
183
     */
184
    public function setIsLiked(bool $isLiked): void
185
    {
186
        $this->isLiked = $isLiked;
14✔
187
    }
2✔
188

189
    /**
190
     * @return int
191
     */
192
    public function getComments(): int
193
    {
194
        return $this->comments;
7✔
195
    }
196

197
    /**
198
     * @param int $comments
199
     */
200
    public function setComments(int $comments): void
201
    {
202
        $this->comments = $comments;
14✔
203
    }
2✔
204

205
    /**
206
     * @return int
207
     */
208
    public function getViews(): int
209
    {
210
        return $this->views;
7✔
211
    }
212

213
    /**
214
     * @param int $views
215
     */
216
    public function setViews(int $views): void
217
    {
218
        $this->views = $views;
14✔
219
    }
2✔
220

221
    /**
222
     * @return int
223
     */
224
    public function getPlays(): int
225
    {
226
        return $this->plays;
7✔
227
    }
228

229
    /**
230
     * @param int $plays
231
     */
232
    public function setPlays(int $plays): void
233
    {
234
        $this->plays = $plays;
14✔
235
    }
2✔
236

237
    /**
238
     * @return float
239
     */
240
    public function getDuration(): float
241
    {
242
        return $this->duration;
7✔
243
    }
244

245
    /**
246
     * @param float $duration
247
     */
248
    public function setDuration(float $duration): void
249
    {
250
        $this->duration = $duration;
14✔
251
    }
2✔
252

253
    /**
254
     * @return int
255
     */
256
    public function getHeight(): int
257
    {
258
        return $this->height;
7✔
259
    }
260

261
    /**
262
     * @param int $height
263
     */
264
    public function setHeight(int $height): void
265
    {
266
        $this->height = $height;
14✔
267
    }
2✔
268

269
    /**
270
     * @return int
271
     */
272
    public function getWidth(): int
273
    {
274
        return $this->width;
7✔
275
    }
276

277
    /**
278
     * @param int $width
279
     */
280
    public function setWidth(int $width): void
281
    {
282
        $this->width = $width;
14✔
283
    }
2✔
284

285
    /**
286
     * @return bool
287
     */
288
    public function getHasAudio(): bool
289
    {
290
        return $this->hasAudio;
7✔
291
    }
292

293
    /**
294
     * @param bool $width
295
     */
296
    public function setHasAudio(bool $hasAudio): void
297
    {
298
        $this->hasAudio = $hasAudio;
14✔
299
    }
2✔
300

301
    /**
302
     * @return array
303
     */
304
    public function getImages(): array
305
    {
306
        return $this->images;
7✔
307
    }
308

309
    /**
310
     * @param array $images
311
     */
312
    public function setImages(array $images): void
313
    {
314
        $this->images = $images;
14✔
315
    }
2✔
316

317
    /**
318
     * @return array
319
     */
320
    public function getVideos(): array
321
    {
322
        return $this->videos;
7✔
323
    }
324

325
    /**
326
     * @param array $video
327
     */
328
    public function setVideos(array $videos): void
329
    {
330
        $this->videos = $videos;
14✔
331
    }
2✔
332

333
    /**
334
     * @param string $caption
335
     */
336
    public function setCaption(?string $caption): void
337
    {
338
        $this->caption = $caption;
14✔
339
    }
2✔
340

341
    /**
342
     * @return string
343
     */
344
    public function getCaption(): ?string
345
    {
346
        return $this->caption;
7✔
347
    }
348

349
    /**
350
     * @return mixed
351
     */
352
    public function getLocation()
353
    {
354
        return $this->location;
7✔
355
    }
356

357
    /**
358
     * @param \StdClass $location
359
     */
360
    public function setLocation(\StdClass $location): void
361
    {
362
        $this->location = $location;
×
363
    }
364

365
    /**
366
     * @return \DateTime
367
     */
368
    public function getDate(): \DateTime
369
    {
370
        return $this->date;
7✔
371
    }
372

373
    /**
374
     * @param \DateTime $date
375
     */
376
    public function setDate(\DateTime $date): void
377
    {
378
        $this->date = $date;
14✔
379
    }
2✔
380

381
    /**
382
     * @return array
383
     */
384
    public function getHashtags(): array
385
    {
386
        return $this->hashtags;
7✔
387
    }
388

389
    /**
390
     * @param array $hashtags
391
     */
392
    public function setHashtags(array $hashtags): void
393
    {
394
        $this->hashtags = $hashtags;
14✔
395
    }
2✔
396

397
    /**
398
     * @return array
399
     */
400
    public function getUserTags(): array
401
    {
402
        return $this->userTags;
7✔
403
    }
404

405
    /**
406
     * @param array $userTags
407
     */
408
    public function setUserTags(array $userTags): void
409
    {
410
        $this->userTags = $userTags;
14✔
411
    }
2✔
412

413
    /**
414
     * @param User $user
415
     */
416
    public function setUser(User $user): void
417
    {
418
        $this->user = $user;
14✔
419
    }
2✔
420

421
    /**
422
     * @return User
423
     */
424
    public function getUser(): User
425
    {
426
        return $this->user;
7✔
427
    }
428

429
    /**
430
     * @return array
431
     */
432
    public function toArray(): array
433
    {
434
        return [
435
            "id"        => $this->getId(),
×
436
            "shortCode" => $this->getShortCode(),
×
437
            "link"      => $this->getLink(),
×
438
            "likes"     => $this->getLikes(),
×
439
            "isLiked"   => $this->isLiked(),
×
440
            "comments"  => $this->getComments(),
×
441
            "views"     => $this->getViews(),
×
442
            "plays"     => $this->getPlays(),
×
443
            "duration"  => $this->getDuration(),
×
444
            "height"    => $this->getHeight(),
×
445
            "width"     => $this->getWidth(),
×
446
            "hasAudio"  => $this->getHasAudio(),
×
447
            "images"    => array_map(function ($image) {
448
                return (array) $image;
×
449
            }, $this->getImages()),
×
450
            "videos"    => array_map(function ($video) {
451
                return (array) $video;
×
452
            }, $this->getVideos()),
×
453
            "caption"   => $this->getCaption(),
×
454
            "location"  => $this->getLocation(),
×
455
            "date"      => $this->getDate(),
×
456
            "hashtags"  => $this->getHashtags(),
×
457
            "userTags"  => array_map(function ($user) {
458
                return $user->toArray();
×
459
            }, $this->getUserTags()),
×
460
            "user"      => $this->getUser()->toArray()
×
461
        ];
462
    }
463

464
    /**
465
     * @return array
466
     */
467
    public function __serialize(): array
468
    {
469
        return $this->toArray();
×
470
    }
471
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc