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

ShippingMethodSetLocalizedNameAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 5 1
A __construct() 0 4 1
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