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.

ChannelBuilder   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 25
c 1
b 0
f 0
dl 0
loc 60
ccs 25
cts 25
cp 1
rs 10
wmc 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setHeader() 0 5 1
A setTeamId() 0 5 1
A setType() 0 5 1
A setPurpose() 0 5 1
A setDisplayName() 0 5 1
A getRequiredFields() 0 16 4
A setName() 0 5 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 2
    public function setTeamId(string $teamId): self
12
    {
13 2
        $this->params['team_id'] = $teamId;
14
15 2
        return $this;
16
    }
17
18 2
    public function setName(string $name): self
19
    {
20 2
        $this->params['name'] = $name;
21
22 2
        return $this;
23
    }
24
25 2
    public function setDisplayName(string $displayName): self
26
    {
27 2
        $this->params['display_name'] = $displayName;
28
29 2
        return $this;
30
    }
31
32 1
    public function setPurpose(string $purpose): self
33
    {
34 1
        $this->params['purpose'] = $purpose;
35
36 1
        return $this;
37
    }
38
39 1
    public function setHeader(string $header): self
40
    {
41 1
        $this->params['header'] = $header;
42
43 1
        return $this;
44
    }
45
46 2
    public function setType(string $type): self
47
    {
48 2
        $this->params['type'] = $type;
49
50 2
        return $this;
51
    }
52
53 5
    protected function getRequiredFields(string $buildType = self::BUILD_FOR_CREATE): array
54
    {
55
        switch ($buildType) {
56 5
            case self::BUILD_FOR_CREATE:
57
                return [
58 3
                    'team_id',
59
                    'name',
60
                    'display_name',
61
                    'type',
62
                ];
63
64 2
            case self::BUILD_FOR_PATCH:
65 1
                return ['id'];
66 1
            case self::BUILD_FOR_UPDATE:
67
            default:
68 1
                return [];
69
        }
70
    }
71
}
72