Test Failed
Push — develop ( f4030e...371b47 )
by Barbara
19:17 queued 15s
created

fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Commercetools\Core\Request\Customers\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\CustomField\Command\SetCustomFieldAction;
7
8
/**
9
 * @package Commercetools\Core\Request\Customers\Command
10
 *
11
 * @method string getAction()
12
 * @method CustomerSetAddressCustomFieldAction setAction(string $action = null)
13
 * @method string getName()
14
 * @method CustomerSetAddressCustomFieldAction setName(string $name = null)
15
 * @method mixed getValue()
16
 * @method CustomerSetAddressCustomFieldAction setValue($value = null)
17
 * @method string getAddressId()
18
 * @method CustomerSetAddressCustomFieldAction setAddressId(string $addressId = null)
19
 */
20
class CustomerSetAddressCustomFieldAction extends SetCustomFieldAction
21
{
22
    public function fieldDefinitions()
23
    {
24
        return [
25
            'action' => [static::TYPE => 'string'],
26
            'name' => [static::TYPE => 'string'],
27
            'value' => [static::TYPE => null],
28
            'addressId' => [static::TYPE => 'string']
29
        ];
30
    }
31
32
    /**
33
     * @param array $data
34
     * @param Context|callable $context
35
     */
36
    public function __construct(array $data = [], $context = null)
37
    {
38
        parent::__construct($data, $context);
39
        $this->setAction('setAddressCustomField');
40
    }
41
42
    /**
43
     * @param string $addressId
44
     * @param Context|callable $context
45
     * @return CustomerSetAddressCustomFieldAction
46
     */
47
    public static function ofAddressId($addressId, $context = null)
48
    {
49
        return static::of($context)->setAddressId($addressId);
50
    }
51
}
52