AirPollution::fetchOzoneData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 3
dl 12
loc 12
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
namespace Netgen\Bundle\OpenWeatherMapBundle\Core;
4
5
use Netgen\Bundle\OpenWeatherMapBundle\API\OpenWeatherMap\Weather\AirPollutionInterface;
6
7
/**
8
 * Class AirPollution.
9
 */
10
class AirPollution extends Base implements AirPollutionInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 View Code Duplication
    public function fetchOzoneData($latitude, $longitude, $datetime = 'current')
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
    {
17
        if ($datetime instanceof \DateTime) {
18
            $datetime = $datetime->format('c');
19
        } else {
20
            $datetime = 'current';
21
        }
22
23
        $queryPart = '/co/' . $latitude . ',' . $longitude . '/' . $datetime . '.json?appid=' . $this->apiKey;
24
25
        return $this->getResult(self::BASE_URL, $queryPart);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 View Code Duplication
    public function fetchCarbonMonoxideData($latitude, $longitude, $datetime = 'current')
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        if ($datetime instanceof \DateTime) {
34
            $datetime = $datetime->format('c');
35
        } else {
36
            $datetime = 'current';
37
        }
38
39
        $queryPart = '/co/' . $latitude . ',' . $longitude . '/' . $datetime . '.json?appid=' . $this->apiKey;
40
41
        return $this->getResult(self::BASE_URL, $queryPart);
42
    }
43
}
44