CityId   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCityId() 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 CityId implements GetParameterInterface
10
{
11
    /**
12
     * @var int
13
     */
14
    protected $cityId;
15
16
    /**
17
     * CityId constructor.
18
     *
19
     * @param int $cityId
20
     */
21
    public function __construct(int $cityId)
22
    {
23
        $this->cityId = $cityId;
24
    }
25
26
    /**
27
     * @return int
28
     */
29
    public function getCityId(): int
30
    {
31
        return $this->cityId;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getGetParameterValue(): string
38
    {
39
        return (string) $this->cityId;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getGetParameterName(): string
46
    {
47
        return 'id';
48
    }
49
}
50