BitBucketServiceFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 14 1
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