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

Resource::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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
}