Passed
Push — master ( f423b9...e8cce1 )
by Pulkit
10:09 queued 07:24
created

LastFm::getProviderName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace Sourceout\LastFm\Providers\LastFm;
3
4
use Sourceout\LastFm\Http\Http;
5
use Sourceout\LastFm\Http\HttpInterface;
6
use Sourceout\LastFm\Providers\GeoInterface;
7
use Sourceout\LastFm\Providers\ProviderInterface;
8
use Sourceout\LastFm\Providers\ResourceInterface;
9
use Sourceout\LastFm\Providers\LastFm\Resources\Geo;
10
use Sourceout\LastFm\Providers\LastFm\Resources\Resource;
11
12
class LastFm implements ProviderInterface
13
{
14
    /** @var array */
15
    protected $config;
16
17
    /** @inheritDoc */
18 12
    public function __construct(array $config)
19
    {
20 12
        $this->config = $config;
21 12
    }
22
23
    /** @inheritDoc */
24 6
    public function getConfig() : array
25
    {
26 6
        return $this->config;
27
    }
28
29
    /** @inheritDoc */
30 1
    public function setConfig(array $config) : void
31
    {
32 1
        $this->config = $config;
33 1
    }
34
35
    /**
36
     * Setter for API Key (Provider Specific Method)
37
     *
38
     * @param string $apiKey
39
     * @return void
40
     */
41 1
    public function setApiKey(string $apiKey) : void
42
    {
43 1
        $this->config['api_key'] = $apiKey;
44 1
    }
45
46
    /**
47
     * Getter for API Key (Provider Specific Method)
48
     *
49
     * @return string
50
     */
51 1
    public function getApiKey() : string
52
    {
53 1
        return $this->config['api_key'];
54
    }
55
56
    /** @inheritDoc */
57 1
    public function getVersion() : string
58
    {
59 1
        return '2.0';
60
    }
61
62
    /** @inheritDoc */
63 1
    public function getProviderName() : string
64
    {
65 1
        return 'LastFm';
66
    }
67
68
    /** @inheritDoc */
69 1
    public function getResource(HttpInterface $http)
70
    {
71 1
        return new Resource($this, $http);
72
    }
73
}