Passed
Push — master ( 0057b2...3e8fcf )
by Marek
02:11
created

JiraServiceFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 16 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace AppBuilder\Application\Module\Jira\Factory;
6
7
use AppBuilder\Application\Configuration\ValueObject\Parameters;
8
use AppBuilder\Application\Module\HttpClient\ExternalLibraryHttpClient;
9
use AppBuilder\Application\Module\Jira\ExternalLibraryJiraService;
10
use AppBuilder\Application\Module\Jira\QueryRepository;
11
use GuzzleHttp\Client;
12
use Psr\Log\LoggerInterface;
13
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
14
15
class JiraServiceFactory
16
{
17
    public function create(
18
        Parameters $applicationParams,
19
        EventDispatcherInterface $dispatcher,
20
        LoggerInterface $logger,
21
        QueryRepository $queryRepository
22
    ) : ExternalLibraryJiraService {
23
        return new ExternalLibraryJiraService(
24
            new ExternalLibraryHttpClient(
25
                new Client(['base_uri' => $applicationParams->jiraHost()]),
26
                $applicationParams
27
            ),
28
            $logger,
29
            $dispatcher,
30
            $queryRepository
31
        );
32
    }
33
}
34