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.

StatementResponse::fromResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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