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

VatIdNoAwareTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 2
cbo 2
dl 0
loc 30
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setVatIdNo() 0 8 2
A setTaxNo() 0 8 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