CurrencyManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setCurrency() 0 3 1
A getCurrencies() 0 3 1
1
<?php
2
3
namespace LaravelCryptoStats\Services;
4
5
trait CurrencyManager
6
{
7
    /**
8
     * Service config instance.
9
     *
10
     * @var array
11
     */
12
    protected $config;
13
14
    /**
15
     * Cryptocurrency of the created instance.
16
     *
17
     * @var string
18
     */
19
    protected $currency;
20
21
    /**
22
     * Return the list of the cryptocurrencies defined n the config.
23
     *
24
     * @return array
25
     */
26
    public function getCurrencies()
27
    {
28
        return $this->config['currencies'];
29
    }
30
31
    /**
32
     * Set the value of the $currency variable.
33
     *
34
     * @param string $currency
35
     */
36
    public function setCurrency($currency)
37
    {
38
        $this->currency = $currency;
39
    }
40
}
41