Passed
Push — develop ( 798982...a0c2ed )
by Barbara
33:03 queued 14s
created

fieldDefinitions()   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 1
Bugs 0 Features 1
Metric Value
eloc 3
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Commercetools\Core\Request\Project\Command;
4
5
use Commercetools\Core\Model\Common\Context;
6
use Commercetools\Core\Request\AbstractAction;
7
8
/**
9
 * @package Commercetools\Core\Request\Project\Command
10
 * @link  https://docs.commercetools.com/http-api-projects-project.html#change-country-tax-rate-fallback-enabled
11
 * @method string getAction()
12
 * @method ProjectChangeCountryTaxRateFallbackEnabledAction setAction(string $action = null)
13
 * @method bool getCountryTaxRateFallbackEnabled()
14
 * phpcs:disable
15
 * @method ProjectChangeCountryTaxRateFallbackEnabledAction setCountryTaxRateFallbackEnabled(bool $countryTaxRateFallbackEnabled = null)
16
 * phpcs:enable
17
 */
18
class ProjectChangeCountryTaxRateFallbackEnabledAction extends AbstractAction
19
{
20 3
    public function fieldDefinitions()
21
    {
22
        return [
23 3
            'action' => [static::TYPE => 'string'],
24 3
            'countryTaxRateFallbackEnabled' => [static::TYPE => 'bool'],
25
        ];
26
    }
27
28
    /**
29
     * @param array $data
30
     * @param Context|callable $context
31
     */
32 3
    public function __construct(array $data = [], $context = null)
33
    {
34 3
        parent::__construct($data, $context);
35 3
        $this->setAction('changeCountryTaxRateFallbackEnabled');
36 3
    }
37
38
    /**
39
     * @param boolean $countryTaxRateFallbackEnabled
40
     * @param Context|callable $context
41
     * @return ProjectChangeCountryTaxRateFallbackEnabledAction
42
     */
43 1
    public static function ofCountryTaxRateFallbackEnabled($countryTaxRateFallbackEnabled, $context = null)
44
    {
45 1
        return static::of($context)->setCountryTaxRateFallbackEnabled($countryTaxRateFallbackEnabled);
46
    }
47
}
48