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.

Accept   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 2
dl 0
loc 40
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 17 5
A getSubPart() 0 4 1
A getBasePart() 0 4 1
1
<?php
2
3
namespace Negotiation;
4
5
use Negotiation\Exception\InvalidMediaType;
6
7
final class Accept extends BaseAccept implements AcceptHeader
8
{
9
    private $basePart;
10
11
    private $subPart;
12
13 60
    public function __construct($value)
14
    {
15 60
        parent::__construct($value);
16
17 60
        if ($this->type === '*') {
18 2
            $this->type = '*/*';
19 2
        }
20
21 60
        $parts = explode('/', $this->type);
22
23 60
        if (count($parts) !== 2 || !$parts[0] || !$parts[1]) {
24 5
            throw new InvalidMediaType();
25
        }
26
27 58
        $this->basePart = $parts[0];
28 58
        $this->subPart  = $parts[1];
29 58
    }
30
31
    /**
32
     * @return string
33
     */
34 38
    public function getSubPart()
35
    {
36 38
        return $this->subPart;
37
    }
38
39
    /**
40
     * @return string
41
     */
42 38
    public function getBasePart()
43
    {
44 38
        return $this->basePart;
45
    }
46
}
47