GithubFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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