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

CartSetShippingRateInputAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

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