It seems like $connection defined by new \AMQPAL\Adapter\PhpA...ion, $channelPrototype) on line 30 can also be of type array or object<Traversable>; however, AMQPAL\Adapter\PhpAmqpLi...nnection::__construct() does only seem to accept object<PhpAmqpLib\Connec...ions\ConnectionOptions>, 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...
31
}
32
8
$this->registerConnection($connection);
33
8
}
34
35
/**
36
* @param Connection $connection
37
*/
38
8
public function registerConnection(Connection $connection)
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.