Passed
Push — develop ( 75f654...c9f5c5 )
by Jens
09:18 queued 12s
created

OrderSetCustomerIdAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A fieldDefinitions() 0 5 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Request\Orders\Command;
6
7
use Commercetools\Core\Model\Common\Context;
8
use Commercetools\Core\Request\AbstractAction;
9
10
/**
11
 * @package Commercetools\Core\Request\Orders\Command
12
 *
13
 * @link https://docs.commercetools.com/http-api-projects-orders.html#set-customer-id
14
 * @method string getAction()
15
 * @method OrderSetCustomerIdAction setAction(string $action = null)
16
 * @method string getCustomerId()
17
 * @method OrderSetCustomerIdAction setCustomerId(string $customerId = null)
18
 */
19
class OrderSetCustomerIdAction extends AbstractAction
20
{
21 4
    public function fieldDefinitions()
22
    {
23
        return [
24 4
            'action' => [static::TYPE => 'string'],
25 4
            'customerId' => [static::TYPE => 'string'],
26
        ];
27
    }
28
29
    /**
30
     * @param array $data
31
     * @param Context|callable $context
32
     */
33 4
    public function __construct(array $data = [], $context = null)
34
    {
35 4
        parent::__construct($data, $context);
36 4
        $this->setAction('setCustomerId');
37 4
    }
38
}
39