GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c6d03b...e8435c )
by Ema
02:43
created

PostBuilder::getRequiredFields()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pnz\MattermostClient\Model\Post;
6
7
use Pnz\MattermostClient\Model\ModelBuilder;
8
9
class PostBuilder extends ModelBuilder
10
{
11
    /**
12
     * @param $message
13
     *
14
     * @return $this
15
     */
16 2
    public function setMessage($message)
17
    {
18 2
        $this->params['message'] = $message;
19
20 2
        return $this;
21
    }
22
23
    /**
24
     * @param $channelId
25
     *
26
     * @return $this
27
     */
28 2
    public function setChannelId($channelId)
29
    {
30 2
        $this->params['channel_id'] = $channelId;
31
32 2
        return $this;
33
    }
34
35
    /**
36
     * Set the post ID to comment on.
37
     *
38
     * @param $postId
39
     *
40
     * @return $this
41
     */
42 1
    public function setRootId(string $postId)
43
    {
44 1
        $this->params['root_id'] = $postId;
45
46 1
        return $this;
47
    }
48
49
    /**
50
     * A list of file IDs to associate with the post.
51
     *
52
     * @param $fileIds
53
     *
54
     * @return $this
55
     */
56 1
    public function setFileIds(array $fileIds)
57
    {
58 1
        $this->params['file_ids'] = $fileIds;
59
60 1
        return $this;
61
    }
62
63
    /**
64
     * Set if the post is pinned.
65
     *
66
     * @param bool $isPinned
67
     *
68
     * @return $this
69
     */
70 1
    public function setIsPinned(bool $isPinned)
71
    {
72 1
        $this->params['is_pinned'] = $isPinned;
73
74 1
        return $this;
75
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80 5
    protected function getRequiredFields($buildType = self::BUILD_FOR_CREATE)
81
    {
82
        switch ($buildType) {
83 5
            case self::BUILD_FOR_CREATE:
84 3
                return ['channel_id', 'message'];
85
            default:
86 2
                return [];
87
        }
88
    }
89
}
90