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.

ClientInfoResponse::name()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Monobank\Response;
6
7
use Monobank\Response\Model\Account;
8
9
final class ClientInfoResponse
10
{
11
    /**
12
     * @var string
13
     */
14
    private $name;
15
16
    /**
17
     * @var array|Account[]
18
     */
19
    private $accounts;
20
21
    public function __construct(string $name, array $accounts)
22
    {
23
        $this->name = $name;
24
        $this->accounts = $accounts;
25
    }
26
27
    public static function fromResponse(array $data): self
28
    {
29
        $accounts = array_map(function ($account) {
30
            return Account::fromResponse($account);
31
        }, $data['accounts']);
32
33
        return new self($data['name'], $accounts);
34
    }
35
36
    public function name(): string
37
    {
38
        return $this->name;
39
    }
40
41
    public function accounts(): array
42
    {
43
        return $this->accounts;
44
    }
45
}
46