It seems like $handle 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
It seems like $handle can also be of type false; however, parameter $handle of fwrite() 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
It seems like $handle 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
33
fclose(/** @scrutinizer ignore-type */ $handle);
Loading history...
34
35
return true;
36
}
37
38
/**
39
* Counts the number of lines in a $file.
40
*
41
* @param string $file
42
* @param bool $countEmpty
43
*
44
* @return int|null
45
*/
46
public static function count(string $file, bool $countEmpty = false): ?int
It seems like $handle 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
54
while (!feof(/** @scrutinizer ignore-type */ $handle)) {
It seems like $handle 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
It seems like $handle 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
75
fclose(/** @scrutinizer ignore-type */ $handle);
Loading history...
76
77
return $lines;
78
}
79
80
/**
81
* Extracts the extension (without the dot) of a filename alone or contained in a path.
82
*
83
* @param string $filename
84
*
85
* @return string
86
*/
87
public static function extractExtension(string $filename): string