Currency   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 1
A getCurrencies() 0 4 1
1
<?php
2
namespace BPCI\SumUp\Utils;
3
4
class Currency
5
{
6
    const EUR = 'EUR';
7
    const GBP = 'GBP';
8
    const RUB = 'RUB';
9
    const BRL = 'BRL';
10
    const PLN = 'PLN';
11
    const CHF = 'CHF';
12
    const SEK = 'SEK';
13
    const USD = 'USD';
14
 
15 3
    static function isValid(string $currency){
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16 3
        $currencies = self::getCurrencies();
17 3
        return in_array($currency, $currencies);
18
    }
19
20 3
    static function getCurrencies(): array
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
21
    {
22 3
        $rClass = new \ReflectionClass(__CLASS__);
23 3
        return $rClass->getConstants();
24
    }
25
}