Completed
Push — master ( d998d0...abb41b )
by Kamil
38:34
created

DefaultTaxZoneProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getZone() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\CoreBundle\Provider;
13
14
use Sylius\Bundle\SettingsBundle\Model\Settings;
15
use Sylius\Component\Core\Provider\DefaultTaxZoneProviderInterface;
16
17
/**
18
 * @author Mateusz Zalewski <[email protected]>
19
 */
20
class DefaultTaxZoneProvider implements DefaultTaxZoneProviderInterface
21
{
22
    /**
23
     * @var Settings
24
     */
25
    private $settings;
26
27
    /**
28
     * @param Settings $settings
29
     */
30
    public function __construct(Settings $settings)
31
    {
32
        $this->settings = $settings;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getZone()
39
    {
40
        if ($this->settings->has('default_tax_zone')) {
41
            return $this->settings->get('default_tax_zone');
42
        }
43
44
        return null;
45
    }
46
}
47