In this branch, the function will implicitly return null which is incompatible with the type-hinted return Soluble\MediaTools\Video\Detection\InterlaceDetect. Consider adding a return statement or allowing null as return value.
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type.
Let?s take a look at an example:
interfaceReturnsInt{publicfunctionreturnsIntHinted():int;}classMyClassimplementsReturnsInt{publicfunctionreturnsIntHinted():int{if(foo()){return123;}// here: null is implicitly returned}}
Loading history...
34
35
/**
36
* @param int $maxFramesToAnalyze interlacement detection can be heavy, limit the number of frames to analyze
37
*
38
* @throws SPRuntimeException
39
* @throws FileNotFoundException
40
*/
41
1
public function detectInterlacement(string $file, int $maxFramesToAnalyze = 1000): InterlaceGuess
42
{
43
1
$interlaceDetect = new InterlaceDetect($this->ffmpegConfig);
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: