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.

CitySearchBuilder   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A withState() 0 6 1
A create() 0 4 1
A page() 0 6 1
A withName() 0 6 1
A withCountry() 0 6 1
A withStateCode() 0 6 1
A getQuery() 0 4 1
1
<?php
2
3
/*
4
 * (c) Christian Gripp <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Core23\SetlistFm\Builder;
11
12
final class CitySearchBuilder
13
{
14
    /**
15
     * @var array
16
     */
17
    private $query;
18
19
    private function __construct()
20
    {
21
        $this->query = [];
22
23
        $this->page(1);
24
    }
25
26
    /**
27
     * @return CitySearchBuilder
28
     */
29
    public static function create(): self
30
    {
31
        return new static();
32
    }
33
34
    /**
35
     * @return CitySearchBuilder
36
     */
37
    public function page(int $page): self
38
    {
39
        $this->query['p'] = $page;
40
41
        return $this;
42
    }
43
44
    /**
45
     * @return CitySearchBuilder
46
     */
47
    public function withName(string $name): self
48
    {
49
        $this->query['name'] = $name;
50
51
        return $this;
52
    }
53
54
    /**
55
     * @return CitySearchBuilder
56
     */
57
    public function withCountry(string $country): self
58
    {
59
        $this->query['country'] = $country;
60
61
        return $this;
62
    }
63
64
    /**
65
     * @return CitySearchBuilder
66
     */
67
    public function withState(string $name): self
68
    {
69
        $this->query['state'] = $name;
70
71
        return $this;
72
    }
73
74
    /**
75
     * @return CitySearchBuilder
76
     */
77
    public function withStateCode(string $code): self
78
    {
79
        $this->query['stateCode'] = $code;
80
81
        return $this;
82
    }
83
84
    public function getQuery(): array
85
    {
86
        return $this->query;
87
    }
88
}
89