WeatherJSONControllerMock   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getIPData() 0 7 1
A getMultiData() 0 6 1
A getData() 0 6 1
1
<?php
2
3
/**
4
 * Weather Mock
5
 */
6
7
namespace Hepa19\Weather;
8
9
use Hepa19\Weather\WeatherModelMock;
10
use Hepa19\IPGeo\IPStackMock;
11
12
/**
13
 * Mock weather model
14
 *
15
 */
16
class WeatherJSONControllerMock extends WeatherJSONController
17
{
18
    /**
19
     * Get weather data
20
     *
21
     */
22 3
    public function getIPData($location)
23
    {
24 3
        $ipstack = new IPStackMock();
25 3
        $ipstack->setUrl($location);
26 3
        $ipstackRes = $ipstack->getData($location);
0 ignored issues
show
Unused Code introduced by
The call to Hepa19\IPGeo\IPStackMock::getData() has too many arguments starting with $location. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        /** @scrutinizer ignore-call */ 
27
        $ipstackRes = $ipstack->getData($location);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
27
28 3
        return $ipstackRes;
29
    }
30
31
32
33
    /**
34
     * Get weather data
35
     *
36
     * @return object
37
     */
38 1
    public function getData($weather, $lat, $lon)
39
    {
40 1
        $weather = new WeatherModelMock();
41 1
        $weatherInfo = $weather->getData($lat, $lon);
0 ignored issues
show
Unused Code introduced by
The call to Hepa19\Weather\WeatherModelMock::getData() has too many arguments starting with $lat. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
        /** @scrutinizer ignore-call */ 
42
        $weatherInfo = $weather->getData($lat, $lon);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
42
43 1
        return $weatherInfo;
44
    }
45
46
47
48
    /**
49
     * Get weather data multi
50
     *
51
     * @return object
52
     */
53 1
    public function getMultiData($weather, $lat, $lon)
54
    {
55 1
        $weather = new WeatherModelMock();
56 1
        $weatherInfo = $weather->getData($lat, $lon);
0 ignored issues
show
Unused Code introduced by
The call to Hepa19\Weather\WeatherModelMock::getData() has too many arguments starting with $lat. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

56
        /** @scrutinizer ignore-call */ 
57
        $weatherInfo = $weather->getData($lat, $lon);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
57
58 1
        return $weatherInfo;
59
    }
60
}
61