GeoLocationPerformanceReport   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 5
c 4
b 0
f 1
lcom 1
cbo 4
dl 0
loc 52
ccs 20
cts 20
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A createReportRequest() 0 10 1
A setAggregation() 0 4 1
A setColumns() 0 4 1
A setTimePeriod() 0 4 1
A getRequest() 0 4 1
1
<?php
2
namespace Werkspot\BingAdsApiBundle\Api\Report;
3
4
use BingAds\Reporting\AccountThroughAdGroupReportScope;
5
use BingAds\Reporting\GeoLocationPerformanceReportRequest;
6
use BingAds\Reporting\NonHourlyReportAggregation;
7
use BingAds\Reporting\ReportFormat;
8
use BingAds\Reporting\ReportTime;
9
10
class GeoLocationPerformanceReport extends BaseReport
11
{
12
    const NAME = 'GeoLocationPerformanceReportRequest';
13
14
    /**
15
     * @var GeoLocationPerformanceReportRequest
16
     */
17
    protected $reportRequest;
18
19 27
    protected function createReportRequest()
20
    {
21 27
        $this->reportRequest = new GeoLocationPerformanceReportRequest();
22 27
        $this->reportRequest->Format = ReportFormat::Csv;
23 27
        $this->reportRequest->ReportName = self::NAME;
24 27
        $this->reportRequest->ReturnOnlyCompleteData = true;
25 27
        $this->reportRequest->Aggregation = NonHourlyReportAggregation::Daily;
26 27
        $this->reportRequest->Scope = new AccountThroughAdGroupReportScope();
27 27
        $this->reportRequest->Time = new ReportTime();
28 27
    }
29
30
    /**
31
     * @param string $aggregation (See BingAds SDK documentation)
32
     */
33 1
    public function setAggregation($aggregation)
34
    {
35 1
        $this->reportRequest->Aggregation = $aggregation;
36 1
    }
37
38
    /**
39
     * @param array $columns
40
     */
41 26
    public function setColumns(array $columns)
42
    {
43 26
        $this->reportRequest->Columns = $columns;
44 26
    }
45
46
    /**
47
     * @param string $timePeriod (See BingAds SDK documentation)
48
     */
49 26
    public function setTimePeriod($timePeriod)
50
    {
51 26
        $this->reportRequest->Time->PredefinedTime = $timePeriod;
0 ignored issues
show
Documentation Bug introduced by
It seems like $timePeriod of type string is incompatible with the declared type object<BingAds\Reporting\ReportTimePeriod> of property $PredefinedTime.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
52 26
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57 26
    public function getRequest()
58
    {
59 26
        return $this->reportRequest;
60
    }
61
}
62