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\Yves\Payone\Model;
9
10
use SprykerEco\Yves\Payone\Dependency\Client\PayoneToStoreClientInterface;
11
12
class StoreReader implements StoreReaderInterface
13
{
14
    /**
15
     * @var \SprykerEco\Yves\Payone\Dependency\Client\PayoneToStoreClientInterface
16
     */
17
    protected PayoneToStoreClientInterface $storeClient;
18
19
    /**
20
     * @param \SprykerEco\Yves\Payone\Dependency\Client\PayoneToStoreClientInterface $storeClient
21
     */
22
    public function __construct(PayoneToStoreClientInterface $storeClient)
23
    {
24
        $this->storeClient = $storeClient;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getDefaultStoreCountry(): string
31
    {
32
        return current($this->storeClient->getCurrentStore()->getCountries());
33
    }
34
}
35