Completed
Pull Request — master (#4)
by Laurens
03:17
created

BaseReport   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 8
Bugs 0 Features 1
Metric Value
wmc 6
c 8
b 0
f 1
lcom 1
cbo 1
dl 0
loc 53
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createReportRequest() 0 4 1
A setFormat() 0 4 1
A setReturnOnlyCompleteData() 0 4 1
A setReportLanguage() 0 4 1
A getRequest() 0 4 1
1
<?php
2
namespace Werkspot\BingAdsApiBundle\Api\Report;
3
4
use BingAds\Reporting\ReportRequest;
5
6
class BaseReport implements ReportInterface
7
{
8
    const WSDL = 'https://api.bingads.microsoft.com/Api/Advertiser/Reporting/V9/ReportingService.svc?singleWsdl';
9
    const FILE_HEADERS = 10;
10
    const COLUMN_HEADERS = 1;
11
12
    /**
13
     * @var ReportRequest
14
     */
15
    protected $reportRequest;
16
17
    public function __construct()
18
    {
19
        $this->createReportRequest();
20
    }
21
22
    protected function createReportRequest()
23
    {
24
        $this->reportRequest = new ReportRequest();
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function setFormat($format)
31
    {
32
        $this->reportRequest->Format = $format;
1 ignored issue
show
Documentation Bug introduced by
It seems like $format of type string is incompatible with the declared type object<BingAds\Reporting\ReportFormat> of property $Format.

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...
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function setReturnOnlyCompleteData($returnOnlyCompleteData)
39
    {
40
        $this->reportRequest->ReturnOnlyCompleteData = $returnOnlyCompleteData;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function setReportLanguage($language)
47
    {
48
        $this->reportRequest->Language = $language;
1 ignored issue
show
Documentation Bug introduced by
It seems like $language of type string is incompatible with the declared type object<BingAds\Reporting\ReportLanguage> of property $Language.

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...
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getRequest()
55
    {
56
        return $this->reportRequest;
57
    }
58
}
59