GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#177)
by Eric
06:31 queued 03:20
created

PlacePhotoRequest   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 107
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 12
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 107
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getReference() 0 4 1
A setReference() 0 4 1
A hasMaxWidth() 0 4 1
A getMaxWidth() 0 4 1
A setMaxWidth() 0 4 1
A hasMaxHeight() 0 4 1
A getMaxHeight() 0 4 1
A setMaxHeight() 0 4 1
A buildQuery() 0 14 3
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Service\Place\Photo\Request;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class PlacePhotoRequest implements PlacePhotoRequestInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    private $reference;
23
24
    /**
25
     * @var int|null
26
     */
27
    private $maxWidth;
28
29
    /**
30
     * @var int|null
31
     */
32
    private $maxHeight;
33
34
    /**
35
     * @param string $reference
36
     */
37
    public function __construct($reference)
38
    {
39
        $this->setReference($reference);
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getReference()
46
    {
47
        return $this->reference;
48
    }
49
50
    /**
51
     * @param string $reference
52
     */
53
    public function setReference($reference)
54
    {
55
        $this->reference = $reference;
56
    }
57
58
    /**
59
     * @return bool
60
     */
61
    public function hasMaxWidth()
62
    {
63
        return $this->maxWidth !== null;
64
    }
65
66
    /**
67
     * @return int|null
68
     */
69
    public function getMaxWidth()
70
    {
71
        return $this->maxWidth;
72
    }
73
74
    /**
75
     * @param int|null $maxWidth
76
     */
77
    public function setMaxWidth($maxWidth)
78
    {
79
        $this->maxWidth = $maxWidth;
80
    }
81
82
    /**
83
     * @return bool
84
     */
85
    public function hasMaxHeight()
86
    {
87
        return $this->maxHeight !== null;
88
    }
89
90
    /**
91
     * @return int|null
92
     */
93
    public function getMaxHeight()
94
    {
95
        return $this->maxHeight;
96
    }
97
98
    /**
99
     * @param int|null $maxHeight
100
     */
101
    public function setMaxHeight($maxHeight)
102
    {
103
        $this->maxHeight = $maxHeight;
104
    }
105
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function buildQuery()
110
    {
111
        $query = ['photoreference' => $this->reference];
112
113
        if ($this->hasMaxWidth()) {
114
            $query['maxwidth'] = $this->maxWidth;
115
        }
116
117
        if ($this->hasMaxHeight()) {
118
            $query['maxheight'] = $this->maxHeight;
119
        }
120
121
        return $query;
122
    }
123
}
124