CurrencyForeign   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 8
c 0
b 0
f 0
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 0 9 1
1
<?php
2
3
/**
4
 * This file is part of riesenia/pohoda package.
5
 *
6
 * Licensed under the MIT License
7
 * (c) RIESENIA.com
8
 */
9
10
declare(strict_types=1);
11
12
namespace Riesenia\Pohoda\Type;
13
14
use Riesenia\Pohoda\AbstractAgenda;
15
use Riesenia\Pohoda\Common\OptionsResolver;
16
use Riesenia\Pohoda\Common\SetNamespaceTrait;
17
18
class CurrencyForeign extends AbstractAgenda
19
{
20
    use SetNamespaceTrait;
21
22
    /** @var string[] */
23
    protected array $refElements = ['currency'];
24
25
    /** @var string[] */
26
    protected array $elements = ['currency', 'rate', 'amount', 'priceSum'];
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 1
    protected function configureOptions(OptionsResolver $resolver): void
32
    {
33
        // available options
34 1
        $resolver->setDefined($this->elements);
35
36
        // validate / format options
37 1
        $resolver->setNormalizer('rate', $this->normalizerFactory->getClosure('float'));
38 1
        $resolver->setNormalizer('amount', $this->normalizerFactory->getClosure('int'));
39 1
        $resolver->setNormalizer('priceSum', $this->normalizerFactory->getClosure('float'));
40
    }
41
}
42