It seems like $address defined by is_a($address, \Recca012...pcode\Address($address) on line 35 can also be of type string; however, Recca0120\Twzipcode\Contracts\Storage::zip3() does only seem to accept object<Recca0120\Twzipcode\Address>, 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.
Loading history...
37
38
7
if (empty($zip3) === true) {
39
return;
40
}
41
42
7
$rule = $this->storage->rules($zip3)->find(function ($rule) use ($address) {
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:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.