Passed
Push — master ( d5de2f...778d32 )
by Carsten
12:45
created

VatIdNoAwareTrait::setTaxNo()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
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
9
    use VatIdNoProviderTrait;
10
11
    /**
12
     * @inheritdoc
13
     */
14 8
    public function setVatIdNo( $vatin )
15
    {
16 8
        if ($vatin instanceOf VatIdNoProviderInterface)
17 5
            $vatin = $vatin->getVatIdNo();
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 5
            $taxno = $taxno->getTaxNo();
31
32 8
        $this->taxno = $taxno;
33 8
        return $this;
34
    }
35
}
36