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

ProjectChangeCountryTaxRateFallbackEnabledAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
eloc 7
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10
c 1
b 0
f 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A ofCountryTaxRateFallbackEnabled() 0 3 1
A __construct() 0 4 1
A fieldDefinitions() 0 5 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