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

fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 CartSetShippingAddressCustomFieldAction setAction(string $action = null)
13
 * @method string getName()
14
 * @method CartSetShippingAddressCustomFieldAction setName(string $name = null)
15
 * @method mixed getValue()
16
 * @method CartSetShippingAddressCustomFieldAction setValue($value = null)
17
 */
18
class CartSetShippingAddressCustomFieldAction 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('setShippingAddressCustomField');
37
    }
38
}
39