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

ChannelSetAddressCustomFieldAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
dl 0
loc 19
rs 10
c 1
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\Channels\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\CustomField\Command\SetCustomFieldAction;
7
8
/**
9
 * @package Commercetools\Core\Request\Channels\Command
10
 *
11
 * @method string getAction()
12
 * @method ChannelSetAddressCustomFieldAction setAction(string $action = null)
13
 * @method string getName()
14
 * @method ChannelSetAddressCustomFieldAction setName(string $name = null)
15
 * @method mixed getValue()
16
 * @method ChannelSetAddressCustomFieldAction setValue($value = null)
17
 * @method string getAddressId()
18
 * @method ChannelSetAddressCustomFieldAction setAddressId(string $addressId = null)
19
 */
20
class ChannelSetAddressCustomFieldAction 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
        ];
29
    }
30
31
    /**
32
     * @param array $data
33
     * @param Context|callable $context
34
     */
35
    public function __construct(array $data = [], $context = null)
36
    {
37
        parent::__construct($data, $context);
38
        $this->setAction('setAddressCustomField');
39
    }
40
}
41