ShippingAvataxCodeResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTaxCode() 0 9 2
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