RecyclingContrib   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 0 10 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 RecyclingContrib extends AbstractAgenda
19
{
20
    use SetNamespaceTrait;
21
22
    /** @var string[] */
23
    protected array $refElements = ['recyclingContribType'];
24
25
    /** @var string[] */
26
    protected array $elements = ['recyclingContribText', 'recyclingContribAmount', 'recyclingContribUnit', 'coefficientOfRecyclingContrib'];
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('recyclingContribText', $this->normalizerFactory->getClosure('string64'));
38 1
        $resolver->setNormalizer('recyclingContribAmount', $this->normalizerFactory->getClosure('float'));
39 1
        $resolver->setNormalizer('recyclingContribUnit', $this->normalizerFactory->getClosure('string10'));
40 1
        $resolver->setNormalizer('coefficientOfRecyclingContrib', $this->normalizerFactory->getClosure('float'));
41
    }
42
}
43