WeatherMock   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 26
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getWeatherPast() 0 6 1
A getWeatherUpcoming() 0 5 1
1
<?php
2
namespace Blixter\Mock;
3
4
class WeatherMock
5
{
6
    /**
7
     * Function that takes an coordinate and gets upcomming weather.
8
     *
9
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
10
     * @return array $result
11
     */
12 1
    public function getWeatherUpcoming(): array
13
    {
14 1
        $json = file_get_contents(ANAX_INSTALL_PATH . "/src/Mock/weather-upcoming.json");
15
16 1
        return [$json];
17
    }
18
    /**
19
     * Function that takes an coordinate and get past 30 days weather
20
     *
21
     *
22
     * @return array $result
23
     */
24 1
    public function getWeatherPast(): array
25
    {
26
27 1
        $json = file_get_contents(ANAX_INSTALL_PATH . "/src/Mock/weather-past.json");
28
29 1
        return [$json];
30
    }
31
}
32