Completed
Push — master ( 3abb65...67d89a )
by Christian
17s
created

AirPollutionData::getPressure()   A

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
/*
4
 * OpenWeatherMap-PHP-API — A PHP API to parse weather data from https://OpenWeatherMap.org.
5
 *
6
 * @license MIT
7
 *
8
 * Please see the LICENSE file distributed with this source code for further
9
 * information regarding copyright and licensing.
10
 *
11
 * Please visit the following links to read about the usage policies and the license of
12
 * OpenWeatherMap data before using this library:
13
 *
14
 * @see https://OpenWeatherMap.org/price
15
 * @see https://OpenWeatherMap.org/terms
16
 * @see https://OpenWeatherMap.org/appid
17
 */
18
19
namespace Cmfcmf\OpenWeatherMap;
20
21
/**
22
 * AirPollution class used to hold the air pollution and time of measurement
23
 */
24
class AirPollutionData
25
{
26
    /**
27
     * @var float measurement precision
28
     */
29
    public $precision;
30
31
    /**
32
     * @var float atmospheric pressure at the point of measurement in hPa
33
     */
34
    public $pressure;
35
36
    /**
37
     * @var float volume mixing ratio
38
     */
39
    public $value;
40
41
    /**
42
     * Create a new air pollution data object.
43
     *
44
     * @param object $json
45
     *
46
     * @internal
47
     */
48
    public function __construct($json)
49
    {
50
        $this->precision = (float)$json->precision;
51
        $this->pressure = (float)$json->pressure;
52
        $this->value = (float)$json->value;
53
    }
54
55
    /**
56
     * @return float
57
     */
58
    public function getPrecision(): float
59
    {
60
        return $this->precision;
61
    }
62
63
    /**
64
     * @return float
65
     */
66
    public function getPressure(): float
67
    {
68
        return $this->pressure;
69
    }
70
71
    /**
72
     * @return float
73
     */
74
    public function getValue(): float
75
    {
76
        return $this->value;
77
    }
78
}
79