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   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 1
dl 0
loc 96
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setTeamId() 0 6 1
A setName() 0 6 1
A setDisplayName() 0 6 1
A setType() 0 6 1
A setPurpose() 0 6 1
A setHeader() 0 6 1
A getRequiredFields() 0 18 4
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