Passed
Branch init (43954b)
by Pulkit
05:57
created

Resource   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A geo() 0 4 1
1
<?php
2
namespace Sourceout\LastFm\Providers\LastFm\Resources;
3
4
use Sourceout\LastFm\Http\HttpInterface;
5
use Sourceout\LastFm\Providers\GeoInterface;
6
use Sourceout\LastFm\Providers\ProviderInterface;
7
use Sourceout\LastFm\Providers\ResourceInterface;
8
9
class Resource implements ResourceInterface
10
{
11
    /** @var ProviderInterface */
12
    private $provider;
13
14
    /** @var HttpInterface */
15
    private $http;
16
17
    /**
18
     * Constructor
19
     *
20
     * @param ProviderInterface $provider
21
     * @param HttpInterface $http
22
     */
23
    public function __construct(
24
        ProviderInterface $provider,
25
        HttpInterface $http
26
    ) {
27
        $this->provider = $provider;
28
        $this->http = $http;
29
    }
30
31
    /**
32
     * Returns back an instance of LastFM Geo Resource
33
     *
34
     * @return GeoInterface
35
     */
36
    public function geo() : GeoInterface
37
    {
38
        return new Geo($this->provider, $this->http);
39
    }
40
}