CityId::getCityId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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