Issues (36)

src/Mock/WeatherControllerMock.php (3 issues)

Severity
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 WeatherControllerMock extends WeatherController
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
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 2
    public function getData($weather, $lat, $lon)
39
    {
40 2
        $weather = new WeatherModelMock();
41 2
        $weatherInfo = $weather->getData($lat, $lon);
0 ignored issues
show
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 2
        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
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