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
08:46 queued 06:24
created

PlaceDetailRequest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 0
dl 0
loc 74
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPlaceId() 0 4 1
A setPlaceId() 0 4 1
A hasLanguage() 0 4 1
A getLanguage() 0 4 1
A setLanguage() 0 4 1
A buildQuery() 0 10 2
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\Detail\Request;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class PlaceDetailRequest implements PlaceDetailRequestInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    private $placeId;
23
24
    /**
25
     * @var string|null
26
     */
27
    private $language;
28
29
    /**
30
     * @param string $placeId
31
     */
32
    public function __construct($placeId)
33
    {
34
        $this->setPlaceId($placeId);
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getPlaceId()
41
    {
42
        return $this->placeId;
43
    }
44
45
    /**
46
     * @param string $placeId
47
     */
48
    public function setPlaceId($placeId)
49
    {
50
        $this->placeId = $placeId;
51
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function hasLanguage()
57
    {
58
        return $this->language !== null;
59
    }
60
61
    /**
62
     * @return string|null
63
     */
64
    public function getLanguage()
65
    {
66
        return $this->language;
67
    }
68
69
    /**
70
     * @param string|null $language
71
     */
72
    public function setLanguage($language)
73
    {
74
        $this->language = $language;
75
    }
76
77
    /**
78
     * {@inheritdoc}
79
     */
80
    public function buildQuery()
81
    {
82
        $query = ['placeid' => $this->placeId];
83
84
        if ($this->hasLanguage()) {
85
            $query['language'] = $this->language;
86
        }
87
88
        return $query;
89
    }
90
}
91