Merge "Use PHP7 constant expression instead of a magic number"
[lhc/web/wiklou.git] / includes / cache / GenderCache.php
index 80f04ce..1ec39a5 100644 (file)
@@ -56,7 +56,7 @@ class GenderCache {
 
        /**
         * Returns the gender for given username.
-        * @param string|User $username Username
+        * @param string|User $username
         * @param string $caller The calling method
         * @return string
         */
@@ -85,7 +85,7 @@ class GenderCache {
                /* Undefined if there is a valid username which for some reason doesn't
                 * exist in the database.
                 */
-               return isset( $this->cache[$username] ) ? $this->cache[$username] : $this->getDefault();
+               return $this->cache[$username] ?? $this->getDefault();
        }
 
        /**
@@ -157,7 +157,7 @@ class GenderCache {
                        return;
                }
 
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $table = [ 'user', 'user_properties' ];
                $fields = [ 'user_name', 'up_value' ];
                $conds = [ 'user_name' => $usersToCheck ];