ServiceFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 28
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getGeoService() 0 3 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
}