Completed
Push — develop ( a97860...827a39 )
by Jens
06:38
created

CartRecalculateAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A fieldDefinitions() 0 7 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\Common\Context;
9
use Commercetools\Core\Request\AbstractAction;
10
11
/**
12
 * @package Commercetools\Core\Request\Carts\Command
13
 * @link https://dev.commercetools.com/http-api-projects-carts.html#recalculate
14
 * @method string getAction()
15
 * @method CartRecalculateAction setAction(string $action = null)
16
 * @method bool getUpdateProductData()
17
 * @method CartRecalculateAction setUpdateProductData(bool $updateProductData = null)
18
 */
19
class CartRecalculateAction extends AbstractAction
20
{
21
    /**
22
     * @param array $data
23 3
     * @param Context|callable $context
24
     */
25 3
    public function __construct(array $data = [], $context = null)
26 3
    {
27 3
        parent::__construct($data, $context);
28
        $this->setAction('recalculate');
29
    }
30
31
    public function fieldDefinitions()
32
    {
33
        $definitions = parent::fieldDefinitions();
34
        $definitions['updateProductData'] = [static::TYPE => 'bool'];
35
36
        return $definitions;
37
    }
38
}
39