Passed
Push — master ( bb819e...23296b )
by Carsten
02:08
created

SalesmanInterceptorsTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 22
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setSalesmanId() 0 10 2
1
<?php
2
namespace Germania\Salesmen;
3
4
trait SalesmanInterceptorsTrait
5
{
6
    use SalesmanProviderTrait;
7
8
9
    /**
10
     * Sets the Salesman ID.
11
     *
12
     * @var     int|string|SalesmanProviderInterface $salesman
13
     * @return  self
14
     */
15 2
    public function setSalesmanId( $salesman )
16
    {
17 2
        if ($salesman instanceOf SalesmanProviderInterface):
18 1
            $this->salesman_id = $salesman->getSalesmanId();
19 1
        else:
20 1
            $this->salesman_id = $salesman;
21
        endif;
22
23 2
        return $this;
24
    }
25
}
26