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 ( 89fb33...cd256e )
by Ema
02:19
created

ChannelBuilder::setPurpose()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Pnz\MattermostClient\Model\Channel;
6
7
use Pnz\MattermostClient\Model\ModelBuilder;
8
9
class ChannelBuilder extends ModelBuilder
10
{
11
    /**
12
     * @param string $teamId
13
     *
14
     * @return $this
15
     */
16 2
    public function setTeamId($teamId)
17
    {
18 2
        $this->params['team_id'] = $teamId;
19
20 2
        return $this;
21
    }
22
23
    /**
24
     * @param string $name
25
     *
26
     * @return $this
27
     */
28 2
    public function setName($name)
29
    {
30 2
        $this->params['name'] = $name;
31
32 2
        return $this;
33
    }
34
35
    /**
36
     * @param string $displayName
37
     *
38
     * @return $this
39
     */
40 2
    public function setDisplayName($displayName)
41
    {
42 2
        $this->params['display_name'] = $displayName;
43
44 2
        return $this;
45
    }
46
47
    /**
48
     * @param string $purpose
49
     *
50
     * @return $this
51
     */
52 1
    public function setPurpose($purpose)
53
    {
54 1
        $this->params['purpose'] = $purpose;
55
56 1
        return $this;
57
    }
58
59
    /**
60
     * @param string $header
61
     *
62
     * @return $this
63
     */
64 1
    public function setHeader($header)
65
    {
66 1
        $this->params['header'] = $header;
67
68 1
        return $this;
69
    }
70
71
    /**
72
     * @param string $type
73
     *
74
     * @return $this
75
     */
76 2
    public function setType($type)
77
    {
78 2
        $this->params['type'] = $type;
79
80 2
        return $this;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86 5
    protected function getRequiredFields($buildType = self::BUILD_FOR_CREATE)
87
    {
88
        switch ($buildType) {
89 5
            case self::BUILD_FOR_CREATE:
90
                return [
91 3
                    'team_id',
92
                    'name',
93
                    'display_name',
94
                    'type',
95
                ];
96
97 2
            case self::BUILD_FOR_PATCH:
98 1
                return ['id'];
99 1
            case self::BUILD_FOR_UPDATE:
100
            default:
101 1
                return [];
102
        }
103
    }
104
}
105