Passed
Push — develop ( 38ffd9...9f7101 )
by Jens
31:57 queued 05:22
created

CustomerIdTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 15
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A byCustomerId() 0 7 2
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request;
7
8
use Commercetools\Core\Request\Query\Parameter;
9
use Commercetools\Core\Request\Query\ParameterInterface;
10
11
/**
12
 * @package Commercetools\Core\Request
13
 */
14
trait CustomerIdTrait
15
{
16
    /**
17
     * @param ParameterInterface $param
18
     * @return $this
19
     */
20
    abstract public function addParamObject(ParameterInterface $param);
21
22
    public function byCustomerId($customerId)
23
    {
24
        if (!is_null($customerId)) {
25
            $this->addParamObject(new Parameter('customerId', $customerId));
26
        }
27
28
        return $this;
29
    }
30
}
31