Passed
Push — develop ( 30dd04...761131 )
by Jens
07:47
created

CartSetShippingRateInputAction::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Carts\Command;
7
8
use Commercetools\Core\Model\Cart\ShippingRateInput;
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Request\AbstractAction;
11
12
/**
13
 * @package Commercetools\Core\Request\Carts\Command
14
 * @link https://dev.commercetools.com/http-api-projects-carts.html#set-shippingrateinput
15
 * @method string getAction()
16
 * @method CartSetShippingRateInputAction setAction(string $action = null)
17
 * @method ShippingRateInput getShippingRateInput()
18
 * @method CartSetShippingRateInputAction setShippingRateInput(ShippingRateInput $shippingRateInput = null)
19
 */
20
class CartSetShippingRateInputAction extends AbstractAction
21
{
22 2
    public function fieldDefinitions()
23
    {
24
        return [
25 2
            'action' => [static::TYPE => 'string'],
26 2
            'shippingRateInput' => [static::TYPE => ShippingRateInput::class],
27
        ];
28
    }
29
30
    /**
31
     * @param array $data
32
     * @param Context|callable $context
33
     */
34 2
    public function __construct(array $data = [], $context = null)
35
    {
36 2
        parent::__construct($data, $context);
37 2
        $this->setAction('setShippingRateInput');
38 2
    }
39
}
40