The expression return file(self::getFileUrl($file)) could also return false which is incompatible with the documented return type array. Did you maybe forget to handle an error condition?
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.
Loading history...
32
}
33
34
/**
35
* Found string inside file
36
*
37
* @param string $string
38
* @param string $file
39
* @return bool
40
*/
41
public static function foundInFile($string, $file)
It seems like $fileHandle can also be of type false; however, parameter $handle of feof() does only seem to accept resource, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
44
while (!feof(/** @scrutinizer ignore-type */ $fileHandle)) {
It seems like $fileHandle can also be of type false; however, parameter $handle of fgets() does only seem to accept resource, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
45
if (trim($string) === trim(fgets(/** @scrutinizer ignore-type */ $fileHandle))){
It seems like $fileHandle can also be of type false; however, parameter $handle of fclose() does only seem to accept resource, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.