Passed
Push — master ( 3f8301...c7321f )
by Jens
42:49 queued 17:59
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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/http-api-projects-shippingMethods.html#set-localized-description
12
 * @method string getAction()
13
 * @method ShippingMethodSetLocalizedDescriptionAction setAction(string $action = null)
14
 * @method LocalizedString getLocalizedDescription()
15
 * phpcs:disable
16
 * @method ShippingMethodSetLocalizedDescriptionAction setLocalizedDescription(LocalizedString $localizedDescription = null)
17
 * phpcs:enable
18
 */
19
class ShippingMethodSetLocalizedDescriptionAction extends AbstractAction
20
{
21 3
    public function fieldDefinitions()
22
    {
23
        return [
24 3
            'action' => [static::TYPE => 'string'],
25 3
            'localizedDescription' => [static::TYPE => LocalizedString::class],
26
        ];
27
    }
28
29
    /**
30
     * @param array $data
31
     * @param Context|callable $context
32
     */
33 3
    public function __construct(array $data = [], $context = null)
34
    {
35 3
        parent::__construct($data, $context);
36 3
        $this->setAction('setLocalizedDescription');
37 3
    }
38
}
39