Passed
Pull Request — develop (#423)
by nikos
09:13
created

CartRemoveItemShippingAddressAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
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 __construct() 0 4 1
A fieldDefinitions() 0 5 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Request\Carts\Command;
6
7
use Commercetools\Core\Model\Common\Context;
8
use Commercetools\Core\Request\AbstractAction;
9
10
/**
11
 * @package Commercetools\Core\Request\Carts\Command
12
 * @link https://docs.commercetools.com/http-api-projects-carts.html#remove-itemshippingaddress
13
 * @method string getAction()
14
 * @method CartRemoveItemShippingAddressAction setAction(string $action = null)
15
 * @method string getAddressKey()
16
 * @method CartRemoveItemShippingAddressAction setAddressKey(string $addressKey = null)
17
 */
18
class CartRemoveItemShippingAddressAction extends AbstractAction
19
{
20 6
    public function fieldDefinitions()
21
    {
22
        return [
23 6
            'action' => [static::TYPE => 'string'],
24 6
            'addressKey' => [static::TYPE => 'string'],
25
        ];
26
    }
27
28
    /**
29
     * @param array $data
30
     * @param Context|callable $context
31
     */
32 6
    public function __construct(array $data = [], $context = null)
33
    {
34 6
        parent::__construct($data, $context);
35 6
        $this->setAction('removeItemShippingAddress');
36 6
    }
37
}
38