It seems like $resource defined by parameter $resource on line 22 can also be of type boolean; however, Runalyze\DEM\Provider\Ab...ceReader::setResource() does only seem to accept resource, maybe add an additional type check?
This check looks at variables that have been passed in as parameters and are passed out again
to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.
Loading history...
26
}
27
8
}
28
29
public function __destruct()
30
{
31
$this->closeResource();
32
}
33
34
/**
35
* @param resource $resource
36
* @throws \RuntimeException
37
*/
38
6
public function setResource($resource)
39
{
40
6
$this->closeResource();
41
42
6
$this->FileResource = $resource;
43
44
6
if (false === $this->FileResource) {
45
throw new \RuntimeException('Provider file "'.$filename.'"" can\'t be opened for reading.');
46
}
47
6
}
48
49
6
protected function closeResource()
50
{
51
6
if (is_resource($this->FileResource)) {
52
fclose($this->FileResource);
53
}
54
6
}
55
56
abstract public function readHeader();
57
58
/**
59
* @param int $row
60
* @param int $col
61
* @return int|bool elevation [m] can be false if nothing retrieved or value is unknown
62
*/
63
abstract public function getElevationFor($row, $col);
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.