VatIdNoAwareTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
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 31
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

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