Localization_Currency_EUR::getStructuralTemplate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AppLocalize;
6
7
use AppLocalize\Localization\Countries\CountryInterface;
8
use AppLocalize\Localization\Currencies\BaseCurrency;
9
10
class Localization_Currency_EUR extends BaseCurrency
11
{
12
    public const ISO_CODE = 'EUR';
13
14
    public function getSingular() : string
15
    {
16
        return t('Euro');
17
    }
18
19
    public function getSymbol() : string
20
    {
21
        return '€';
22
    }
23
24
    public function getPlural() : string
25
    {
26
        return t('Euros');
27
    }
28
29
    public function isSymbolOnFront() : bool
30
    {
31
        return false;
32
    }
33
34
    public function isNamePreferred() : bool
35
    {
36
        return false;
37
    }
38
39
    public function getStructuralTemplate(?CountryInterface $country=null): string
40
    {
41
        if($country instanceof Localization_Country_FR) {
42
            return '- {amount} {symbol}';
43
        }
44
45
        return '-{amount} {symbol}';
46
    }
47
48
    public function getISO() : string
49
    {
50
        return self::ISO_CODE;
51
    }
52
}
53