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

CartRecalculateAction::__construct()   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
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
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\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