GeoLocationPerformanceReport::getRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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