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 ( cc194b...accbf4 )
by Daniel
12:20 queued 01:33
created

IssuerMeta::fromRdnSequence()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 1
dl 0
loc 13
ccs 0
cts 8
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace LiquidWeb\SslCertificate;
4
5
class IssuerMeta
6
{
7
    protected $commonName;
8
    protected $countryName;
9
    protected $organizationName;
10
    protected $organizationUnitName;
11
12
    public static function fromRdnSequence(array $input): self
13
    {
14
        $items = [];
15
        foreach ($input as $arr) {
16
            // Get the actual item
17
            $rawItem = $arr[0];
18
            $type = explode('id-at-', $rawItem['type'])[1];
19
            $value = $rawItem['value']['printableString'];
20
            $items[$type] = $value;
21
        }
22
23
        return new static($items);
24
    }
25
26
    public function __construct(array $input = [])
27
    {
28
        $this->commonName = isset($input['commonName']) ? $input['commonName'] : '';
29
        $this->countryName = ($input['countryName']) ? $input['countryName'] : '';
30
        $this->organizationName = isset($input['organizationName']) ? $input['organizationName'] : '';
31
        $this->organizationUnitName = isset($input['organizationalUnitName']) ? $input['organizationalUnitName'] : '';
32
    }
33
}
34