GithubFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dandelion\VersionControl\Platform;
6
7
use Dandelion\Configuration\Vcs;
8
use GuzzleHttp\ClientInterface as HttpClientInterface;
9
10
class GithubFactory implements PlatformFactoryInterface
11
{
12
    /**
13
     * @var \GuzzleHttp\ClientInterface
14
     */
15
    protected $httpClient;
16
17
    /**
18
     * @param \GuzzleHttp\ClientInterface $httpClient
19
     */
20
    public function __construct(HttpClientInterface $httpClient)
21
    {
22
        $this->httpClient = $httpClient;
23
    }
24
25
    /**
26
     * @param \Dandelion\Configuration\Vcs $vcs
27
     *
28
     * @return \Dandelion\VersionControl\Platform\PlatformInterface
29
     */
30
    public function create(Vcs $vcs): PlatformInterface
31
    {
32
        return new Github($this->httpClient, $vcs);
33
    }
34
}
35