ShippingAvataxCodeResolver::getTaxCode()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 2
eloc 4
c 2
b 1
f 0
nc 2
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusAvataxPlugin\Resolver;
6
7
use Odiseo\SyliusAvataxPlugin\Entity\AvataxConfigurationInterface;
8
9
final class ShippingAvataxCodeResolver implements ShippingAvataxCodeResolverInterface
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function getTaxCode(AvataxConfigurationInterface $configuration): string
15
    {
16
        $taxCode = 'FR010000';
17
        if ($configuration->getShippingTaxCode() !== null) {
18
            /** @var string $taxCode */
19
            $taxCode = $configuration->getShippingTaxCode();
20
        }
21
22
        return $taxCode;
23
    }
24
}
25