Completed
Pull Request — master (#138)
by Christian
01:27
created

NO2AirPollution   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
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\AirPollution;
20
21
use Cmfcmf\OpenWeatherMap\Util\Unit;
22
23
class NO2AirPollution extends BaseAirPollution
24
{
25
26
    /**
27
     * @var Unit
28
     */
29
    public $value;
30
31
    /**
32
     * @var Unit
33
     */
34
    public $valueStratosphere;
35
36
    /**
37
     * @var Unit
38
     */
39
    public $valueTroposphere;
40
41
    public function __construct($json)
42
    {
43
        parent::__construct($json);
44
45
        $this->value = new Unit($json->data->no2->value, "g/m³", "", $json->data->no2->precision);
46
        $this->valueStratosphere = new Unit($json->data->no2_strat->value, "g/m³", "", $json->data->no2_strat->precision);
47
        $this->valueTroposphere = new Unit($json->data->no2_trop->value, "g/m³", "", $json->data->no2_trop->precision);
48
    }
49
}
50