CityCount::__construct()   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 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 CityCount implements GetParameterInterface
10
{
11
    /**
12
     * @var int
13
     */
14
    protected $cnt;
15
16
    /**
17
     * CityCount constructor.
18
     *
19
     * @param int $cnt
20
     */
21
    public function __construct(int $cnt = 10)
22
    {
23
        $this->cnt = $cnt;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getGetParameterValue(): string
30
    {
31
        return (string) $this->cnt;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getGetParameterName(): string
38
    {
39
        return 'cnt';
40
    }
41
}
42