CityCount   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 33
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 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 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