It seems like the GitHub access token used for retrieving details about this repository from
GitHub became invalid. This might prevent certain types of inspections from being run (in
particular,
everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
The expression $this->filesystem->read($path); of type string|boolean adds the type boolean to the return on line 45 which is incompatible with the return type declared by the interface HtImgModule\Imagine\Loader\LoaderInterface::load of type HtImgModule\Binary\Binary|string.
Loading history...
37
1
} catch (FileNotFoundException $e) {
38
1
throw new Exception\ImageNotFoundException(sprintf('Source image not found in "%s"', $path));
It seems like $contents defined by $this->filesystem->read($path) on line 36 can also be of type boolean; however, HtImgModule\Binary\Binary::__construct() does only seem to accept string, maybe add an additional type check?
If a method or function can return multiple different values and unless you are
sure that you only can receive a single value in this context, we recommend
to add an additional type check:
/** * @return array|string */functionreturnsDifferentValues($x){if($x){return'foo';}returnarray();}$x=returnsDifferentValues($y);if(is_array($x)){// $x is an array.}
If this a common case that PHP Analyzer should handle natively, please let us
know by opening an issue.