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.

CurrencyRatesResponse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromResponse() 0 5 1
A rates() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Monobank\Response;
6
7
use Monobank\Response\Model\CurrencyInfo;
8
9
final class CurrencyRatesResponse
10
{
11
    /**
12
     * @var array|CurrencyInfo[]
13
     */
14
    private $rates;
15
16
    public function __construct(array $rates)
17
    {
18
        $this->rates = $rates;
19
    }
20
21
    public static function fromResponse(array $data): self
22
    {
23
        return new self(array_map(function (array $currencyInfo) {
24
            return CurrencyInfo::fromResponse($currencyInfo);
25
        }, $data));
26
    }
27
28
    public function rates(): array
29
    {
30
        return $this->rates;
31
    }
32
}
33