Test Setup Failed
Push — master ( 4f349b...502500 )
by Carsten
05:09
created

SalesmanIdAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 21
rs 10

1 Method

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