Test Failed
Push — develop ( a91eee...f77bbc )
by Jens
17:10 queued 15s
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Commercetools\Core\Request\ShippingMethods\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Model\Common\LocalizedString;
7
use Commercetools\Core\Request\AbstractAction;
8
9
/**
10
 * @package Commercetools\Core\Request\ShippingMethods\Command
11
 * @link https://docs.commercetools.com/api/projects/shippingMethods#set-localized-name
12
 * @method string getAction()
13
 * @method ShippingMethodSetLocalizedNameAction setAction(string $action = null)
14
 * @method LocalizedString getLocalizedName()
15
 * @method ShippingMethodSetLocalizedNameAction setLocalizedName(LocalizedString $localizedName = null)
16
 */
17
class ShippingMethodSetLocalizedNameAction extends AbstractAction
18
{
19
    public function fieldDefinitions()
20
    {
21
        return [
22
            'action' => [static::TYPE => 'string'],
23
            'localizedName' => [static::TYPE => LocalizedString::class],
24
        ];
25
    }
26
27
    /**
28
     * @param array $data
29
     * @param Context|callable $context
30
     */
31
    public function __construct(array $data = [], $context = null)
32
    {
33
        parent::__construct($data, $context);
34
        $this->setAction('setLocalizedName');
35
    }
36
}
37