VatIdNoAwareTrait::setVatIdNo()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
namespace Germania\VatIdNo;
3
4
use Germania\VatIdNo\VatIdNoProviderInterface;
5
6
trait VatIdNoAwareTrait
7
{
8
    use VatIdNoProviderTrait;
9
10
    /**
11
     * @inheritdoc
12
     */
13 8
    public function setVatIdNo($vatin)
14
    {
15 8
        if ($vatin instanceof VatIdNoProviderInterface) {
16 4
            $vatin = $vatin->getVatIdNo();
17
        }
18
19 8
        $this->vatin = $vatin;
20 8
        return $this;
21
    }
22
23
24
    /**
25
     * @inheritdoc
26
     */
27 8
    public function setTaxNo($taxno)
28
    {
29 8
        if ($taxno instanceof VatIdNoProviderInterface) {
30 4
            $taxno = $taxno->getTaxNo();
31
        }
32
33 8
        $this->taxno = $taxno;
34 8
        return $this;
35
    }
36
}
37