Completed
Push — master ( 12a313...e137a7 )
by ARCANEDEV
7s
created

ArrayStore   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 40
ccs 8
cts 8
cp 1
rs 10
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setConfigs() 0 4 1
A rates() 0 7 1
1
<?php namespace Arcanedev\Currencies\Stores;
2
3
use Arcanedev\Currencies\Bases\AbstractService;
4
use Illuminate\Support\Arr;
5
6
/**
7
 * Class     ArrayStore
8
 *
9
 * @package  Arcanedev\Currencies\Stores
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class ArrayStore extends AbstractService
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Properties
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /** @var array */
19
    protected $configs = [];
20
21
    /* ------------------------------------------------------------------------------------------------
22
     |  Getters & Setters
23
     | ------------------------------------------------------------------------------------------------
24
     */
25
    /**
26
     * Set the configs.
27
     *
28
     * @param  array $configs
29
     */
30 24
    protected function setConfigs(array $configs)
31
    {
32 24
        $this->configs = $configs;
33 24
    }
34
35
    /* ------------------------------------------------------------------------------------------------
36
     |  Main Functions
37
     | ------------------------------------------------------------------------------------------------
38
     */
39
    /**
40
     * Get currencies rates.
41
     *
42
     * @return \Arcanedev\Currencies\Entities\RateCollection
43
     */
44 12
    public function rates()
45
    {
46 12
        return $this->makeRatesCollection(
47 12
            $this->getDefault(),
48 12
            Arr::get($this->configs, 'rates', [])
49 9
        );
50
    }
51
}
52