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

ServiceFactory::getGeoService()   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\Services;
3
4
use Sourceout\LastFm\Http\HttpInterface;
5
use Sourceout\LastFm\Providers\ProviderInterface;
6
7
class ServiceFactory
8
{
9
    /** @var ProviderInterface */
10
    private $provider;
11
12
    /** @var HttpInterface */
13
    private $http;
14
15
    /**
16
     * Constructor method for the client
17
     *
18
     * @param ProviderInterface $provider
19
     * @param HttpInterface $http
20
     */
21 2
    public function __construct(ProviderInterface $provider, HttpInterface $http)
22
    {
23 2
        $this->provider = $provider;
24 2
        $this->http = $http;
25 2
    }
26
27
    /**
28
     * Return an instance of GeoService for the Provider
29
     *
30
     * @return GeoService
31
     */
32 1
    public function getGeoService() : GeoService
33
    {
34 1
        return new GeoService($this->provider, $this->http);
35
    }
36
}