BoundingBox   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getGetParameterValue() 0 8 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 BoundingBox implements GetParameterInterface
10
{
11
    /**
12
     * @var float
13
     */
14
    protected $longitudeLeft;
15
16
    /**
17
     * @var float
18
     */
19
    protected $latitudeBottom;
20
21
    /**
22
     * @var float
23
     */
24
    protected $longitudeRight;
25
26
    /**
27
     * @var float
28
     */
29
    protected $latitudeTop;
30
31
    /**
32
     * @var int
33
     */
34
    protected $zoom;
35
36
    /**
37
     * BoundingBox constructor.
38
     *
39
     * @param float $longitudeLeft
40
     * @param float $latitudeBottom
41
     * @param float $longitudeRight
42
     * @param float $latitudeTop
43
     * @param int $zoom
44
     */
45
    public function __construct(float $longitudeLeft, float $latitudeBottom, float $longitudeRight, float $latitudeTop, int $zoom)
46
    {
47
        $this->longitudeLeft = $longitudeLeft;
48
        $this->latitudeBottom = $latitudeBottom;
49
        $this->longitudeRight = $longitudeRight;
50
        $this->latitudeTop = $latitudeTop;
51
        $this->zoom = $zoom;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getGetParameterValue(): string
58
    {
59
        return (string) $this->longitudeLeft
60
            . ',' . (string) $this->latitudeBottom
61
            . ',' . (string) $this->longitudeRight
62
            . ',' . (string) $this->latitudeTop
63
            . ',' . (string) $this->zoom;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function getGetParameterName(): string
70
    {
71
        return 'bbox';
72
    }
73
}
74