Header::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 14
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 13
c 0
b 0
f 0
dl 0
loc 17
ccs 14
cts 14
cp 1
rs 9.8333
cc 1
nc 1
nop 1
crap 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\IntDoc;
13
14
use Riesenia\Pohoda\Common\OptionsResolver;
15
use Riesenia\Pohoda\Document\AbstractHeader;
16
17
class Header extends AbstractHeader
18
{
19
    /** @var string[] */
20
    protected array $refElements = ['number', 'accounting', 'classificationVAT', 'classificationKVDPH', 'centre', 'activity', 'contract', 'regVATinEU', 'MOSS', 'evidentiaryResourcesMOSS'];
21
22
    /** @var string[] */
23
    protected array $elements = ['number', 'symVar', 'symPar', 'originalDocumentNumber', 'originalCorrectiveDocument', 'date', 'dateTax', 'dateAccounting', 'dateDelivery', 'dateKVDPH', 'dateKHDPH', 'accounting', 'classificationVAT', 'classificationKVDPH', 'numberKHDPH', 'text', 'partnerIdentity', 'myIdentity', 'liquidation', 'centre', 'activity', 'contract', 'regVATinEU', 'MOSS', 'evidentiaryResourcesMOSS', 'accountingPeriodMOSS', 'note', 'intNote', 'markRecord'];
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    protected function configureOptions(OptionsResolver $resolver): void
29
    {
30 1
        parent::configureOptions($resolver);
31
32
        // validate / format options
33 1
        $resolver->setNormalizer('symVar', $this->normalizerFactory->getClosure('string20'));
34 1
        $resolver->setNormalizer('symPar', $this->normalizerFactory->getClosure('string20'));
35 1
        $resolver->setNormalizer('date', $this->normalizerFactory->getClosure('date'));
36 1
        $resolver->setNormalizer('dateTax', $this->normalizerFactory->getClosure('date'));
37 1
        $resolver->setNormalizer('dateAccounting', $this->normalizerFactory->getClosure('date'));
38 1
        $resolver->setNormalizer('dateDelivery', $this->normalizerFactory->getClosure('date'));
39 1
        $resolver->setNormalizer('dateKVDPH', $this->normalizerFactory->getClosure('date'));
40 1
        $resolver->setNormalizer('dateKHDPH', $this->normalizerFactory->getClosure('date'));
41 1
        $resolver->setNormalizer('numberKHDPH', $this->normalizerFactory->getClosure('string32'));
42 1
        $resolver->setNormalizer('text', $this->normalizerFactory->getClosure('string240'));
43 1
        $resolver->setNormalizer('liquidation', $this->normalizerFactory->getClosure('bool'));
44 1
        $resolver->setNormalizer('markRecord', $this->normalizerFactory->getClosure('bool'));
45
    }
46
}
47