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

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