Since I4fdf7f7 more code stops returning the implementation, but only
returns the interface. This is a good, very welcome change. However,
ConnectionManager still requires the LoadBalancer implementation, for
no obvious reason. All code in this class works fine with the interface.
This is currently reported by Phan as a violation (and it actually is
one), e.g.:
https://integration.wikimedia.org/ci/job/mwext-php70-phan-docker/6433/console
Change-Id: I63cbb98fd277b0c64ab8b303888b9354c4be29e2
class ConnectionManager {
/**
- * @var LoadBalancer
+ * @var ILoadBalancer
*/
private $loadBalancer;
private $groups = [];
/**
- * @param LoadBalancer $loadBalancer
+ * @param ILoadBalancer $loadBalancer
* @param string|bool $domain Optional logical DB name, defaults to current wiki.
* This follows the convention for database names used by $loadBalancer.
* @param string[] $groups see LoadBalancer::getConnection
*
* @throws InvalidArgumentException
*/
- public function __construct( LoadBalancer $loadBalancer, $domain = false, array $groups = [] ) {
+ public function __construct( ILoadBalancer $loadBalancer, $domain = false, array $groups = [] ) {
if ( !is_string( $domain ) && $domain !== false ) {
throw new InvalidArgumentException( '$dbName must be a string, or false.' );
}