BitBucketServiceFactory::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 3
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace AppBuilder\Application\Module\BitBucket\Factory;
6
7
use AppBuilder\Application\Configuration\ValueObject\Parameters;
8
use AppBuilder\Application\Module\BitBucket\ExternalLibraryBitBucketService;
9
use AppBuilder\Application\Module\HttpClient\ExternalLibraryHttpClient;
10
use GuzzleHttp\Client;
11
use Psr\Log\LoggerInterface;
12
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
13
14
class BitBucketServiceFactory
15
{
16
    public function create(
17
        Parameters $applicationParams,
18
        LoggerInterface $logger,
19
        EventDispatcherInterface $dispatcher
20
    ) : ExternalLibraryBitBucketService {
21
        return new ExternalLibraryBitBucketService(
22
            new ExternalLibraryHttpClient(
23
                new Client(['base_uri' => $applicationParams->jiraHost()]),
24
                $applicationParams
25
            ),
26
            $logger,
27
            $dispatcher
28
        );
29
    }
30
}
31