Test Failed
Pull Request — develop (#620)
by Barbara
25:46
created

CartSetBillingAddressCustomFieldAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 6 1
A __construct() 0 4 1
1
<?php
2
3
namespace Commercetools\Core\Request\Carts\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\CustomField\Command\SetCustomFieldAction;
7
8
/**
9
 * @package Commercetools\Core\Request\Carts\Command
10
 *
11
 * @method string getAction()
12
 * @method CartSetBillingAddressCustomFieldAction setAction(string $action = null)
13
 * @method string getName()
14
 * @method CartSetBillingAddressCustomFieldAction setName(string $name = null)
15
 * @method mixed getValue()
16
 * @method CartSetBillingAddressCustomFieldAction setValue($value = null)
17
 */
18
class CartSetBillingAddressCustomFieldAction extends SetCustomFieldAction
19
{
20
    public function fieldDefinitions()
21
    {
22
        return [
23
            'action' => [static::TYPE => 'string'],
24
            'name' => [static::TYPE => 'string'],
25
            'value' => [static::TYPE => null],
26
        ];
27
    }
28
29
    /**
30
     * @param array $data
31
     * @param Context|callable $context
32
     */
33
    public function __construct(array $data = [], $context = null)
34
    {
35
        parent::__construct($data, $context);
36
        $this->setAction('setBillingAddressCustomField');
37
    }
38
}
39