WeatherModelMock   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 33
c 1
b 0
f 0
dl 0
loc 54
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 0 47 1
1
<?php
2
3
/**
4
 * Weather Mock
5
 */
6
7
namespace Hepa19\Weather;
8
9
/**
10
 * Mock weather model
11
 *
12
 */
13
class WeatherModelMock extends WeatherModel
14
{
15
    /**
16
     * Mock data for successful curl
17
     *
18
     * @return array $res Result
19
     */
20 5
    public function getData()
21
    {
22
        $res = [
23 5
            "location" => "8.8.8.8",
24
            "longitude" => -122.074310302734375,
25
            "latitude" => 37.388019561767578125,
26
            "weather"  => [
27
                [
28
                    "date" => "17/11",
29
                    "temp" => 14,
30
                    "wind" => 2,
31
                    "desc" => "klar himmel",
32
                    "icon" => "http://openweathermap.org/img/wn/[email protected]"
33
                ],
34
                [
35
                    "date" => "18/11",
36
                    "temp" => 14,
37
                    "wind" => 6,
38
                    "desc" => "molnigt",
39
                    "icon" => "http://openweathermap.org/img/wn/[email protected]"
40
                ],
41
                [
42
                    "date" => "19/11",
43
                    "temp" => 9,
44
                    "wind" => 1,
45
                    "desc" => "klar himmel",
46
                    "icon" => "http://openweathermap.org/img/wn/[email protected]"
47
                ],
48
                [
49
                    "date" => "20/11",
50
                    "temp" =>  7,
51
                    "wind" =>  2,
52
                    "desc" => "klar himmel",
53
                    "icon" => "http://openweathermap.org/img/wn/[email protected]"
54
                ],
55
                [
56
                    "date" => "21/11",
57
                    "temp" => 8,
58
                    "wind" => 1,
59
                    "desc" => "klar himmel",
60
                    "icon" => "http://openweathermap.org/img/wn/[email protected]"
61
                ]
62
            ],
63
            "map_link" => "https://www.openstreetmap.org/#map=13/37.388019561768/-122.07431030273"
64
        ];
65
66 5
        return $res;
67
    }
68
}
69