Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / includes / libs / rdbms / loadmonitor / LoadMonitorMySQL.php
index 98cff6d..dda980c 100644 (file)
@@ -39,9 +39,7 @@ class LoadMonitorMySQL extends LoadMonitor {
        ) {
                parent::__construct( $lb, $srvCache, $wCache, $options );
 
-               $this->warmCacheRatio = isset( $options['warmCacheRatio'] )
-                       ? $options['warmCacheRatio']
-                       : 0.0;
+               $this->warmCacheRatio = $options['warmCacheRatio'] ?? 0.0;
        }
 
        protected function getWeightScale( $index, IDatabase $conn = null ) {
@@ -51,7 +49,7 @@ class LoadMonitorMySQL extends LoadMonitor {
 
                $weight = 1.0;
                if ( $this->warmCacheRatio > 0 ) {
-                       $res = $conn->query( 'SHOW STATUS', false );
+                       $res = $conn->query( 'SHOW STATUS', __METHOD__ );
                        $s = $res ? $conn->fetchObject( $res ) : false;
                        if ( $s === false ) {
                                $host = $this->parent->getServerName( $index );