Question   D
last analyzed

Complexity

Total Complexity 141

Size/Duplication

Total Lines 795
Duplicated Lines 1.89 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

Changes 0
Metric Value
wmc 141
lcom 1
cbo 7
dl 15
loc 795
rs 4.4444
c 0
b 0
f 0

92 Methods

Rating   Name   Duplication   Size   Complexity  
D fromJson() 15 113 50
B fromProperties() 0 94 1
A getUpvoted() 0 4 1
A setUpvoted() 0 6 1
A getScore() 0 4 1
A setScore() 0 6 1
A getQuestionId() 0 4 1
A setQuestionId() 0 6 1
A getLink() 0 4 1
A setLink() 0 6 1
A getBountyAmount() 0 4 1
A setBountyAmount() 0 6 1
A getBody() 0 4 1
A setBody() 0 6 1
A getBodyMarkdown() 0 4 1
A setBodyMarkdown() 0 6 1
A getIsAnswered() 0 4 1
A setIsAnswered() 0 6 1
A getCanFlag() 0 4 1
A setCanFlag() 0 6 1
A getCreationDate() 0 4 1
A setCreationDate() 0 6 1
A getOwner() 0 4 1
A setOwner() 0 6 1
A setCommunityOwnedDate() 0 6 1
A getCommunityOwnedDate() 0 4 1
A setLockedDate() 0 6 1
A getLockedDate() 0 4 1
A setTags() 0 6 1
A getTags() 0 4 1
A setDownvoted() 0 6 1
A isDownvoted() 0 4 1
A setLastActivityDate() 0 6 1
A getLastActivityDate() 0 4 1
A setShareLink() 0 6 1
A getShareLink() 0 4 1
A setTitle() 0 6 1
A getTitle() 0 4 1
A setCommentCount() 0 6 1
A getCommentCount() 0 4 1
A setComments() 0 6 1
A getComments() 0 4 1
A setLastEditDate() 0 6 1
A getLastEditDate() 0 4 1
A setLastEditor() 0 6 1
A getLastEditor() 0 4 1
A setDownVoteCount() 0 6 1
A getDownVoteCount() 0 4 1
A setUpVoteCount() 0 6 1
A getUpVoteCount() 0 4 1
A setAcceptedAnswerId() 0 6 1
A getAcceptedAnswerId() 0 4 1
A setAnswerCount() 0 6 1
A getAnswerCount() 0 4 1
A setAnswered() 0 6 1
A isAnswered() 0 4 1
A setBountyClosesDate() 0 6 1
A getBountyClosesDate() 0 4 1
A setBountyUser() 0 6 1
A getBountyUser() 0 4 1
A setCanClose() 0 6 1
A isCanClose() 0 4 1
A setCloseVoteCount() 0 6 1
A getCloseVoteCount() 0 4 1
A setClosedDate() 0 6 1
A getClosedDate() 0 4 1
A setClosedDetails() 0 6 1
A getClosedDetails() 0 4 1
A setClosedReason() 0 6 1
A getClosedReason() 0 4 1
A setFavoriteCount() 0 6 1
A getFavoriteCount() 0 4 1
A setFavorited() 0 6 1
A isFavorited() 0 4 1
A setMigratedFrom() 0 6 1
A getMigratedFrom() 0 4 1
A setMigratedTo() 0 6 1
A getMigratedTo() 0 4 1
A setAnswers() 0 6 1
A getAnswers() 0 4 1
A setFlag() 0 6 1
A canFlag() 0 4 1
A setDeleteVoteCount() 0 6 1
A getDeleteVoteCount() 0 4 1
A setNotice() 0 6 1
A getNotice() 0 4 1
A setProtectedDate() 0 6 1
A getProtectedDate() 0 4 1
A setReopenVoteCount() 0 6 1
A getReopenVoteCount() 0 4 1
A setViewCount() 0 6 1
A getViewCount() 0 4 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like Question often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Question, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/*
4
 * This file is part of the Stack Exchange Api Client library.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
/*
14
 * This file is part of the Stack Exchange Api Client library.
15
 *
16
 * (c) Beñat Espiña <[email protected]>
17
 *
18
 * For the full copyright and license information, please view the LICENSE
19
 * file that was distributed with this source code.
20
 */
21
22
namespace BenatEspina\StackExchangeApiClient\Model;
23
24
/**
25
 * The question model class.
26
 *
27
 * @author Beñat Espiña <[email protected]>
28
 */
29
class Question implements Model
30
{
31
    protected $questionId;
32
    protected $acceptedAnswerId;
33
    protected $isAnswered;
34
    protected $answerCount;
35
    protected $answers;
36
    protected $canFlag;
37
    protected $deleteVoteCount;
38
    protected $notice;
39
    protected $protectedDate;
40
    protected $creationDate;
41
    protected $reopenVoteCount;
42
    protected $viewCount;
43
    protected $bountyAmount;
44
    protected $bountyClosesDate;
45
    protected $bountyUser;
46
    protected $canClose;
47
    protected $closeVoteCount;
48
    protected $closedDate;
49
    protected $closedDetails;
50
    protected $closedReason;
51
    protected $favoriteCount;
52
    protected $favorited;
53
    protected $migratedFrom;
54
    protected $migratedTo;
55
    protected $communityOwnedDate;
56
    protected $lockedDate;
57
    protected $owner;
58
    protected $tags;
59
    protected $downvoted;
60
    protected $lastActivityDate;
61
    protected $shareLink;
62
    protected $title;
63
    protected $commentCount;
64
    protected $comments;
65
    protected $lastEditDate;
66
    protected $lastEditor;
67
    protected $downVoteCount;
68
    protected $upVoteCount;
69
    protected $body;
70
    protected $bodyMarkdown;
71
    protected $link;
72
    protected $score;
73
    protected $upvoted;
74
75
    public static function fromJson(array $data)
76
    {
77
        $answers = [];
78 View Code Duplication
        if (array_key_exists('answers', $data) && is_array($data['answers'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
79
            foreach ($data['answers'] as $answer) {
80
                $answers[] = Answer::fromJson($answer);
81
            }
82
        }
83
        $comments = [];
84 View Code Duplication
        if (array_key_exists('comments', $data) && is_array($data['comments'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
85
            foreach ($data['comments'] as $comment) {
86
                $comments[] = Comment::fromJson($comment);
87
            }
88
        }
89
        $tags = [];
90 View Code Duplication
        if (array_key_exists('tags', $data) && is_array($data['tags'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
91
            foreach ($data['tags'] as $tag) {
92
                $tags[] = Tag::fromJson($tag);
93
            }
94
        }
95
96
        $instance = new self();
97
        $instance
98
            ->setAcceptedAnswerId(array_key_exists('accepted_answer_id', $data) ? $data['accepted_answer_id'] : null)
99
            ->setAnswerCount(array_key_exists('answer_count', $data) ? $data['answer_count'] : null)
100
            ->setAnswers($answers)
101
            ->setBody(array_key_exists('body', $data) ? $data['body'] : null)
102
            ->setBodyMarkdown(array_key_exists('body_markdown', $data) ? $data['body_markdown'] : null)
103
            ->setBountyAmount(array_key_exists('body_amount', $data) ? $data['body_amount'] : null)
104
            ->setBountyClosesDate(
105
                array_key_exists('bounty_closes_date', $data)
106
                    ? new \DateTimeImmutable('@' . $data['bounty_closes_date'])
107
                    : null
108
            )
109
            ->setBountyUser(array_key_exists('bounty_user', $data) ? ShallowUser::fromJson($data['bounty_user']) : null)
110
            ->setCanClose(array_key_exists('can_close', $data) ? $data['can_close'] : null)
111
            ->setCanFlag(array_key_exists('can_flag', $data) ? $data['can_flag'] : null)
112
            ->setCloseVoteCount(array_key_exists('close_vote_count', $data) ? $data['close_vote_count'] : null)
113
            ->setClosedDate(
114
                array_key_exists('closed_date', $data)
115
                    ? new \DateTimeImmutable('@' . $data['closed_date'])
116
                    : null
117
            )
118
            ->setClosedDetails(
119
                array_key_exists('closed_details', $data)
120
                    ? CloseDetails::fromJson($data['closed_details'])
121
                    : null
122
            )
123
            ->setClosedReason(array_key_exists('closed_reason', $data) ? $data['closed_reason'] : null)
124
            ->setCommentCount(array_key_exists('comment_count', $data) ? $data['comment_count'] : null)
125
            ->setComments($comments)
126
            ->setCommunityOwnedDate(
127
                array_key_exists('community_owned_date', $data)
128
                    ? new \DateTimeImmutable('@' . $data['community_owned_date'])
129
                    : null
130
            )
131
            ->setCreationDate(
132
                array_key_exists('creation_date', $data)
133
                    ? new \DateTimeImmutable('@' . $data['creation_date'])
134
                    : null
135
            )
136
            ->setDeleteVoteCount(array_key_exists('delete_vote_count', $data) ? $data['delete_vote_count'] : null)
137
            ->setDownVoteCount(array_key_exists('down_vote_count', $data) ? $data['down_vote_count'] : null)
138
            ->setDownvoted(array_key_exists('downvoted', $data) ? $data['downvoted'] : null)
139
            ->setFavoriteCount(array_key_exists('favorite_count', $data) ? $data['favorite_count'] : null)
140
            ->setFavorited(array_key_exists('favorited', $data) ? $data['favorited'] : null)
141
            ->setIsAnswered(array_key_exists('is_answered', $data) ? $data['is_answered'] : null)
142
            ->setLastActivityDate(
143
                array_key_exists('last_activity_date', $data)
144
                    ? new \DateTimeImmutable('@' . $data['last_activity_date'])
145
                    : null
146
            )
147
            ->setLastEditDate(
148
                array_key_exists('last_edit_date', $data)
149
                    ? new \DateTimeImmutable('@' . $data['last_edit_date'])
150
                    : null
151
            )
152
            ->setLastEditor(array_key_exists('last_editor', $data) ? ShallowUser::fromJson($data['last_editor']) : null)
153
            ->setLink(array_key_exists('link', $data) ? $data['link'] : null)
154
            ->setLockedDate(
155
                array_key_exists('locked_date', $data)
156
                    ? new \DateTimeImmutable('@' . $data['locked_date'])
157
                    : null
158
            )
159
            ->setMigratedFrom(
160
                array_key_exists('migrate_from', $data)
161
                    ? MigrationInfo::fromJson($data['migrate_from'])
162
                    : null
163
            )
164
            ->setMigratedTo(
165
                array_key_exists('migrate_to', $data)
166
                    ? MigrationInfo::fromJson($data['migrate_to'])
167
                    : null
168
            )
169
            ->setNotice(array_key_exists('notice', $data) ? Notice::fromJson($data['notice']) : null)
170
            ->setOwner(array_key_exists('owner', $data) ? ShallowUser::fromJson($data['owner']) : null)
171
            ->setProtectedDate(
172
                array_key_exists('protected_date', $data)
173
                    ? new \DateTimeImmutable('@' . $data['protected_date'])
174
                    : null
175
            )
176
            ->setQuestionId(array_key_exists('question_id', $data) ? $data['question_id'] : null)
177
            ->setReopenVoteCount(array_key_exists('reopen_vote_count', $data) ? $data['reopen_vote_count'] : null)
178
            ->setScore(array_key_exists('score', $data) ? $data['score'] : null)
179
            ->setShareLink(array_key_exists('share_link', $data) ? $data['share_link'] : null)
180
            ->setTags($tags)
181
            ->setTitle(array_key_exists('title', $data) ? $data['title'] : null)
182
            ->setUpVoteCount(array_key_exists('up_vote_count', $data) ? $data['up_vote_count'] : null)
183
            ->setUpvoted(array_key_exists('upvoted', $data) ? $data['upvoted'] : null)
184
            ->setViewCount(array_key_exists('view_count', $data) ? $data['view_count'] : null);
185
186
        return $instance;
187
    }
188
189
    public static function fromProperties(
190
        $questionId,
191
        $acceptedAnswerId,
192
        $answerCount,
193
        $bountyAmount,
194
        \DateTimeInterface $bountyClosesDate,
195
        \DateTimeInterface $closedDate,
196
        $closedReason,
197
        \DateTimeInterface $communityOwnedDate,
198
        \DateTimeInterface $creationDate,
199
        $isAnswered,
200
        \DateTimeInterface $lastActivityDate,
201
        \DateTimeInterface $lastEditDate,
202
        ShallowUser $owner,
203
        $link,
204
        $score,
205
206
        $body = null,
207
        $bodyMarkdown = null,
208
        array $answers = [],
209
        $canFlag = null,
210
        $deleteVoteCount = null,
211
        Notice $notice = null,
212
        \DateTimeInterface $protectedDate = null,
213
        array $reopenVoteCount = null,
214
        array $viewCount = null,
215
        ShallowUser $bountyUser = null,
216
        $canClose = null,
217
        $closeVoteCount = null,
218
        ClosedDetails $closedDetails = null,
219
        $favoriteCount = null,
220
        $favorited = null,
221
        MigrationInfo $migratedFrom = null,
222
        MigrationInfo $migratedTo = null,
223
        \DateTimeInterface $lockedDate = null,
224
        array $tags = [],
225
        $downvoted = null,
226
        $shareLink = null,
227
        $title = null,
228
        $commentCount = null,
229
        array $comments = [],
230
        ShallowUser $lastEditor = null,
231
        $upvoted = null,
232
        $downVoteCount = null,
233
        $upVoteCount = null
234
    ) {
235
        $instance = new self();
236
        $instance
237
            ->setAcceptedAnswerId($acceptedAnswerId)
238
            ->setAnswerCount($answerCount)
239
            ->setAnswers($answers)
240
            ->setBody($body)
241
            ->setBodyMarkdown($bodyMarkdown)
242
            ->setBountyAmount($bountyAmount)
243
            ->setBountyClosesDate($bountyClosesDate)
244
            ->setBountyUser($bountyUser)
245
            ->setCanClose($canClose)
246
            ->setCanFlag($canFlag)
247
            ->setCloseVoteCount($closeVoteCount)
248
            ->setClosedDate($closedDate)
249
            ->setClosedDetails($closedDetails)
250
            ->setClosedReason($closedReason)
251
            ->setCommentCount($commentCount)
252
            ->setComments($comments)
253
            ->setCommunityOwnedDate($communityOwnedDate)
254
            ->setCreationDate($creationDate)
255
            ->setDeleteVoteCount($deleteVoteCount)
256
            ->setDownVoteCount($downVoteCount)
257
            ->setDownvoted($downvoted)
258
            ->setFavoriteCount($favoriteCount)
259
            ->setFavorited($favorited)
260
            ->setIsAnswered($isAnswered)
261
            ->setLastActivityDate($lastActivityDate)
262
            ->setLastEditDate($lastEditDate)
263
            ->setLastEditor($lastEditor)
264
            ->setLink($link)
265
            ->setLockedDate($lockedDate)
266
            ->setMigratedFrom($migratedFrom)
267
            ->setMigratedTo($migratedTo)
268
            ->setNotice($notice)
269
            ->setOwner($owner)
270
            ->setProtectedDate($protectedDate)
271
            ->setQuestionId($questionId)
272
            ->setReopenVoteCount($reopenVoteCount)
273
            ->setScore($score)
274
            ->setShareLink($shareLink)
275
            ->setTags($tags)
276
            ->setTitle($title)
277
            ->setUpVoteCount($upVoteCount)
278
            ->setUpvoted($upvoted)
279
            ->setViewCount($viewCount);
280
281
        return $instance;
282
    }
283
284
    public function getUpvoted()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
285
    {
286
        return $this->upvoted;
287
    }
288
289
    public function setUpvoted($upvoted)
290
    {
291
        $this->upvoted = $upvoted;
292
293
        return $this;
294
    }
295
296
    public function getScore()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
297
    {
298
        return $this->score;
299
    }
300
301
    public function setScore($score)
302
    {
303
        $this->score = $score;
304
305
        return $this;
306
    }
307
308
    public function getQuestionId()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
309
    {
310
        return $this->questionId;
311
    }
312
313
    public function setQuestionId($questionId)
314
    {
315
        $this->questionId = $questionId;
316
317
        return $this;
318
    }
319
320
    public function getLink()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
321
    {
322
        return $this->link;
323
    }
324
325
    public function setLink($link)
326
    {
327
        $this->link = $link;
328
329
        return $this;
330
    }
331
332
    public function getBountyAmount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
333
    {
334
        return $this->bountyAmount;
335
    }
336
337
    public function setBountyAmount($bountyAmount)
338
    {
339
        $this->bountyAmount = $bountyAmount;
340
341
        return $this;
342
    }
343
344
    public function getBody()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
345
    {
346
        return $this->body;
347
    }
348
349
    public function setBody($body)
350
    {
351
        $this->body = $body;
352
353
        return $this;
354
    }
355
356
    public function getBodyMarkdown()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
357
    {
358
        return $this->bodyMarkdown;
359
    }
360
361
    public function setBodyMarkdown($bodyMarkdown)
362
    {
363
        $this->bodyMarkdown = $bodyMarkdown;
364
365
        return $this;
366
    }
367
368
    public function getIsAnswered()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
369
    {
370
        return $this->isAnswered;
371
    }
372
373
    public function setIsAnswered($isAnswered)
374
    {
375
        $this->isAnswered = $isAnswered;
376
377
        return $this;
378
    }
379
380
    public function getCanFlag()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
381
    {
382
        return $this->canFlag;
383
    }
384
385
    public function setCanFlag($canFlag)
386
    {
387
        $this->canFlag = $canFlag;
388
389
        return $this;
390
    }
391
392
    public function getCreationDate()
393
    {
394
        return $this->creationDate;
395
    }
396
397
    public function setCreationDate(\DateTimeInterface $creationDate = null)
398
    {
399
        $this->creationDate = $creationDate;
400
401
        return $this;
402
    }
403
404
    public function getOwner()
405
    {
406
        return $this->owner;
407
    }
408
409
    public function setOwner(ShallowUser $owner = null)
410
    {
411
        $this->owner = $owner;
412
413
        return $this;
414
    }
415
416
    public function setCommunityOwnedDate(\DateTimeInterface $communityOwnedDate = null)
417
    {
418
        $this->communityOwnedDate = $communityOwnedDate;
419
420
        return $this;
421
    }
422
423
    public function getCommunityOwnedDate()
424
    {
425
        return $this->communityOwnedDate;
426
    }
427
428
    public function setLockedDate(\DateTimeInterface $lockedDate = null)
429
    {
430
        $this->lockedDate = $lockedDate;
431
432
        return $this;
433
    }
434
435
    public function getLockedDate()
436
    {
437
        return $this->lockedDate;
438
    }
439
440
    public function setTags(array $tags = [])
441
    {
442
        $this->tags = $tags;
443
444
        return $this;
445
    }
446
447
    public function getTags()
448
    {
449
        return $this->tags;
450
    }
451
452
    public function setDownvoted($downvoted)
453
    {
454
        $this->downvoted = $downvoted;
455
456
        return $this;
457
    }
458
459
    public function isDownvoted()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
460
    {
461
        return $this->downvoted;
462
    }
463
464
    public function setLastActivityDate(\DateTimeInterface $lastActivityDate = null)
465
    {
466
        $this->lastActivityDate = $lastActivityDate;
467
468
        return $this;
469
    }
470
471
    public function getLastActivityDate()
472
    {
473
        return $this->lastActivityDate;
474
    }
475
476
    public function setShareLink($shareLink)
477
    {
478
        $this->shareLink = $shareLink;
479
480
        return $this;
481
    }
482
483
    public function getShareLink()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
484
    {
485
        return $this->shareLink;
486
    }
487
488
    public function setTitle($title)
489
    {
490
        $this->title = $title;
491
492
        return $this;
493
    }
494
495
    public function getTitle()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
496
    {
497
        return $this->title;
498
    }
499
500
    public function setCommentCount($commentCount)
501
    {
502
        $this->commentCount = $commentCount;
503
504
        return $this;
505
    }
506
507
    public function getCommentCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
508
    {
509
        return $this->commentCount;
510
    }
511
512
    public function setComments(array $comments = [])
513
    {
514
        $this->comments = $comments;
515
516
        return $this;
517
    }
518
519
    public function getComments()
520
    {
521
        return $this->comments;
522
    }
523
524
    public function setLastEditDate(\DateTimeInterface $lastEditDate = null)
525
    {
526
        $this->lastEditDate = $lastEditDate;
527
528
        return $this;
529
    }
530
531
    public function getLastEditDate()
532
    {
533
        return $this->lastEditDate;
534
    }
535
536
    public function setLastEditor(ShallowUser $lastEditor = null)
537
    {
538
        $this->lastEditor = $lastEditor;
539
540
        return $this;
541
    }
542
543
    public function getLastEditor()
544
    {
545
        return $this->lastEditor;
546
    }
547
548
    public function setDownVoteCount($downVoteCount)
549
    {
550
        $this->downVoteCount = $downVoteCount;
551
552
        return $this;
553
    }
554
555
    public function getDownVoteCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
556
    {
557
        return $this->downVoteCount;
558
    }
559
560
    public function setUpVoteCount($upVoteCount)
561
    {
562
        $this->upVoteCount = $upVoteCount;
563
564
        return $this;
565
    }
566
567
    public function getUpVoteCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
568
    {
569
        return $this->upVoteCount;
570
    }
571
572
    public function setAcceptedAnswerId($acceptedAnswerId)
573
    {
574
        $this->acceptedAnswerId = $acceptedAnswerId;
575
576
        return $this;
577
    }
578
579
    public function getAcceptedAnswerId()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
580
    {
581
        return $this->acceptedAnswerId;
582
    }
583
584
    public function setAnswerCount($answerCount)
585
    {
586
        $this->answerCount = $answerCount;
587
588
        return $this;
589
    }
590
591
    public function getAnswerCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
592
    {
593
        return $this->answerCount;
594
    }
595
596
    public function setAnswered($isAnswered)
597
    {
598
        $this->isAnswered = $isAnswered;
599
600
        return $this;
601
    }
602
603
    public function isAnswered()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
604
    {
605
        return $this->isAnswered;
606
    }
607
608
    public function setBountyClosesDate(\DateTimeInterface $bountyClosesDate = null)
609
    {
610
        $this->bountyClosesDate = $bountyClosesDate;
611
612
        return $this;
613
    }
614
615
    public function getBountyClosesDate()
616
    {
617
        return $this->bountyClosesDate;
618
    }
619
620
    public function setBountyUser(ShallowUser $bountyUser = null)
621
    {
622
        $this->bountyUser = $bountyUser;
623
624
        return $this;
625
    }
626
627
    public function getBountyUser()
628
    {
629
        return $this->bountyUser;
630
    }
631
632
    public function setCanClose($canClose)
633
    {
634
        $this->canClose = $canClose;
635
636
        return $this;
637
    }
638
639
    public function isCanClose()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
640
    {
641
        return $this->canClose;
642
    }
643
644
    public function setCloseVoteCount($closeVoteCount)
645
    {
646
        $this->closeVoteCount = $closeVoteCount;
647
648
        return $this;
649
    }
650
651
    public function getCloseVoteCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
652
    {
653
        return $this->closeVoteCount;
654
    }
655
656
    public function setClosedDate(\DateTimeInterface $closedDate = null)
657
    {
658
        $this->closedDate = $closedDate;
659
660
        return $this;
661
    }
662
663
    public function getClosedDate()
664
    {
665
        return $this->closedDate;
666
    }
667
668
    public function setClosedDetails(ClosedDetails $closedDetails = null)
669
    {
670
        $this->closedDetails = $closedDetails;
671
672
        return $this;
673
    }
674
675
    public function getClosedDetails()
676
    {
677
        return $this->closedDetails;
678
    }
679
680
    public function setClosedReason($closedReason)
681
    {
682
        $this->closedReason = $closedReason;
683
684
        return $this;
685
    }
686
687
    public function getClosedReason()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
688
    {
689
        return $this->closedReason;
690
    }
691
692
    public function setFavoriteCount($favoriteCount)
693
    {
694
        $this->favoriteCount = $favoriteCount;
695
696
        return $this;
697
    }
698
699
    public function getFavoriteCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
700
    {
701
        return $this->favoriteCount;
702
    }
703
704
    public function setFavorited($favorited)
705
    {
706
        $this->favorited = $favorited;
707
708
        return $this;
709
    }
710
711
    public function isFavorited()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
712
    {
713
        return $this->favorited;
714
    }
715
716
    public function setMigratedFrom(MigrationInfo $migratedFrom = null)
717
    {
718
        $this->migratedFrom = $migratedFrom;
719
720
        return $this;
721
    }
722
723
    public function getMigratedFrom()
724
    {
725
        return $this->migratedFrom;
726
    }
727
728
    public function setMigratedTo(MigrationInfo $migratedTo = null)
729
    {
730
        $this->migratedTo = $migratedTo;
731
732
        return $this;
733
    }
734
735
    public function getMigratedTo()
736
    {
737
        return $this->migratedTo;
738
    }
739
740
    public function setAnswers(array $answers = [])
741
    {
742
        $this->answers = $answers;
743
744
        return $this;
745
    }
746
747
    public function getAnswers()
748
    {
749
        return $this->answers;
750
    }
751
752
    public function setFlag($canFlag)
753
    {
754
        $this->canFlag = $canFlag;
755
756
        return $this;
757
    }
758
759
    public function canFlag()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
760
    {
761
        return $this->canFlag;
762
    }
763
764
    public function setDeleteVoteCount($deleteVoteCount)
765
    {
766
        $this->deleteVoteCount = $deleteVoteCount;
767
768
        return $this;
769
    }
770
771
    public function getDeleteVoteCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
772
    {
773
        return $this->deleteVoteCount;
774
    }
775
776
    public function setNotice(Notice $notice = null)
777
    {
778
        $this->notice = $notice;
779
780
        return $this;
781
    }
782
783
    public function getNotice()
784
    {
785
        return $this->notice;
786
    }
787
788
    public function setProtectedDate(\DateTimeInterface $protectedDate = null)
789
    {
790
        $this->protectedDate = $protectedDate;
791
792
        return $this;
793
    }
794
795
    public function getProtectedDate()
796
    {
797
        return $this->protectedDate;
798
    }
799
800
    public function setReopenVoteCount($reopenVoteCount)
801
    {
802
        $this->reopenVoteCount = $reopenVoteCount;
803
804
        return $this;
805
    }
806
807
    public function getReopenVoteCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
808
    {
809
        return $this->reopenVoteCount;
810
    }
811
812
    public function setViewCount($viewCount)
813
    {
814
        $this->viewCount = $viewCount;
815
816
        return $this;
817
    }
818
819
    public function getViewCount()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
820
    {
821
        return $this->viewCount;
822
    }
823
}
824