The expression return Opulence\Environm...Var($envName, $default) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
65
}
66
67
/**
68
* @param string $envName
69
* @param mixed $value
70
*
71
* @return string
72
*/
73
public function set(string $envName, string $value): Provider
In this branch, the function will implicitly return null which is incompatible with the type-hinted return AbterPhp\Framework\Config\Provider. 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}}