Passed
Pull Request — master (#84)
by Olha
12:53
created

StoreReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getDefaultStoreCountry() 0 3 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Payone\Business\Model;
9
10
use SprykerEco\Zed\Payone\Dependency\Facade\PayoneToStoreFacadeInterface;
11
12
class StoreReader implements StoreReaderInterface
13
{
14
    /**
15
     * @var \SprykerEco\Zed\Payone\Dependency\Facade\PayoneToStoreFacadeInterface
16
     */
17
    protected PayoneToStoreFacadeInterface $storeFacade;
18
19
    /**
20
     * @param \SprykerEco\Zed\Payone\Dependency\Facade\PayoneToStoreFacadeInterface $storeClient
21
     */
22
    public function __construct(PayoneToStoreFacadeInterface $storeFacade)
23
    {
24
        $this->storeFacade = $storeFacade;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getDefaultStoreCountry(): string
31
    {
32
        return current($this->storeFacade->getCurrentStore()->getCountries());
33
    }
34
}
35