ReportBuilder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 0
Metric Value
dl 0
loc 18
c 0
b 0
f 0
wmc 1
lcom 0
cbo 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getReportService() 0 14 1
1
<?php
2
3
namespace Audiens\DoubleclickClient;
4
5
use Audiens\DoubleclickClient\authentication\JwtServiceAccountFactory;
6
use Audiens\DoubleclickClient\authentication\Oauth2ServiceAccountStrategy;
7
use Audiens\DoubleclickClient\entity\ServiceAccount;
8
use Audiens\DoubleclickClient\service\Report;
9
use Audiens\DoubleclickClient\service\TwigCompiler;
10
use GuzzleHttp\Client;
11
12
class ReportBuilder
13
{
14
15
    public function getReportService($privateKey, $email, $subject, $cache = null): Report
16
    {
17
        $serviceAccount = new ServiceAccount($privateKey, $email, $subject);
18
19
        $jwtFactory = new JwtServiceAccountFactory($serviceAccount);
20
21
        $authStrategy = new Oauth2ServiceAccountStrategy(new Client(), $cache, $jwtFactory);
22
23
        $auth = new Auth(new Client(), $authStrategy);
24
25
        $report = new Report($auth, new TwigCompiler(), $cache);
26
27
        return $report;
28
    }
29
}
30