Completed
Push — develop ( e61727...1c2218 )
by Jens
08:38
created

fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 7
loc 7
rs 9.4285
ccs 3
cts 3
cp 1
cc 1
eloc 4
nc 1
nop 0
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 http://dev.commercetools.com/http-api-projects-carts.html#change-tax-roundingmode
14
 * @method string getAction()
15
 * @method CartChangeTaxRoundingModeAction setAction(string $action = null)
16
 * @method string getTaxRoundingMode()
17
 * @method CartChangeTaxRoundingModeAction setTaxRoundingMode(string $taxRoundingMode = null)
18
 */
19 View Code Duplication
class CartChangeTaxRoundingModeAction extends AbstractAction
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21 1
    public function fieldDefinitions()
22
    {
23
        return [
24 1
            'action' => [static::TYPE => 'string'],
25 1
            'taxRoundingMode' => [static::TYPE => 'string'],
26
        ];
27
    }
28
29
    /**
30
     * @param array $data
31
     * @param Context|callable $context
32
     */
33 1
    public function __construct(array $data = [], $context = null)
34
    {
35 1
        parent::__construct($data, $context);
36 1
        $this->setAction('changeTaxRoundingMode');
37 1
    }
38
39
    /**
40
     * @param string $roundingMode
41
     * @param Context|callable $context
42
     * @return CartChangeLineItemQuantityAction
43
     */
44 1
    public static function ofTaxRoundingMode($roundingMode, $context = null)
45
    {
46 1
        return static::of($context)->setTaxRoundingMode($roundingMode);
47
    }
48
}
49