Cluster   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSelection() 0 4 1
A getGetParameterValue() 0 4 1
A getGetParameterName() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marek\OpenWeatherMap\API\Value\Parameter\Input;
6
7
use Marek\OpenWeatherMap\API\Value\Parameter\GetParameterInterface;
8
9
class Cluster implements GetParameterInterface
10
{
11
    public const YES = 'yes';
12
13
    public const NO = 'no';
14
15
    /**
16
     * @var string
17
     */
18
    protected $selection;
19
20
    /**
21
     * Cluster constructor.
22
     *
23
     * @param string $selection
24
     */
25
    public function __construct(string $selection = self::YES)
26
    {
27
        $this->selection = $selection;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getSelection()
34
    {
35
        return $this->selection;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function getGetParameterValue(): string
42
    {
43
        return $this->selection;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function getGetParameterName(): string
50
    {
51
        return 'cluster';
52
    }
53
}
54