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

JiraServiceFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 4
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