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 ( ba3ef4...2d5dc2 )
by Cees-Jan
06:20
created

NamedBlob   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 88
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
A getPath() 0 4 1
A getMode() 0 4 1
A getType() 0 4 1
A getSha() 0 4 1
A getContent() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Client\Github\VO;
4
5
use React\Stream\ReadableStreamInterface;
6
7
final class NamedBlob
8
{
9
    /**
10
     * @var string
11
     */
12
    private $path;
13
14
    /**
15
     * @var string
16
     */
17
    private $mode;
18
19
    /**
20
     * @var string
21
     */
22
    private $type;
23
24
    /**
25
     * @var string|null
26
     */
27
    private $sha;
28
29
    /**
30
     * @var ReadableStreamInterface|null
31
     */
32
    private $content;
33
34
    /**
35
     * @param  string                       $path
36
     * @param  string                       $mode
37
     * @param  string                       $type
38
     * @param  string|null                  $sha
39
     * @param  ReadableStreamInterface|null $content
40
     * @throws \Exception
41
     */
42
    public function __construct(string $path, string $mode, string $type, ?string $sha, ?ReadableStreamInterface $content)
43
    {
44
        $this->path = $path;
45
        $this->mode = $mode;
46
        $this->type = $type;
47
        $this->sha = $sha;
48
        $this->content = $content;
49
50
        if ($this->sha === null && $this->content === null) {
51
            throw new \Exception('Only `sha` or `content` can be `null` not both');
52
        }
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getPath(): string
59
    {
60
        return $this->path;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function getMode(): string
67
    {
68
        return $this->mode;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getType(): string
75
    {
76
        return $this->type;
77
    }
78
79
    /**
80
     * @return string|null
81
     */
82
    public function getSha(): ?string
83
    {
84
        return $this->sha;
85
    }
86
87
    /**
88
     * @return ReadableStreamInterface|null
89
     */
90
    public function getContent(): ?ReadableStreamInterface
91
    {
92
        return $this->content;
93
    }
94
}
95