Province   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCountry() 0 3 1
A _container() 0 3 1
1
<?php
2
3
namespace Helix\Shopify\Country;
4
5
use Helix\Shopify\Base\AbstractEntity;
6
use Helix\Shopify\Base\AbstractEntity\UpdateTrait;
7
use Helix\Shopify\Country;
8
9
/**
10
 * Country province settings.
11
 *
12
 * @see https://shopify.dev/docs/admin-api/rest/reference/store-properties/province
13
 *
14
 * @method string       getCode             ()
15
 * @method string       getCountryId        () injected
16
 * @method string       getName             ()
17
 * @method string       getShippingZoneId   ()
18
 * @method string       getTax              ()
19
 * @method string       getTaxName          ()
20
 * @method string       getTaxPercentage    ()
21
 * @method null|string  getTaxType          ()
22
 *
23
 * @method $this        setCode             (string $code)
24
 * @method $this        setName             (string $name)
25
 * @method $this        setShippingZoneId   (string $id)
26
 * @method $this        setTax              (string $tax)
27
 * @method $this        setTaxName          (string $name)
28
 * @method $this        setTaxPercentage    (string $percentage)
29
 * @method $this        setTaxType          (?string $type)
30
 * @todo checked
31
 */
32
class Province extends AbstractEntity
33
{
34
35
    use UpdateTrait;
36
37
    const TYPE = 'province';
38
    const DIR = 'provinces';
39
40
    const TAX_TYPE_NONE = null;
41
    const TAX_TYPE_NORMAL = 'normal';
42
    const TAX_TYPE_HARMONIZED = 'harmonized';
43
    const TAX_TYPE_COMPOUNDED = 'compounded';
44
45
    protected function _container()
46
    {
47
        return $this->getCountry();
48
    }
49
50
    public function getCountry()
51
    {
52
        return Country::load($this, $this->getCountryId());
53
    }
54
55
}