Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / includes / libs / rdbms / ChronologyProtector.php
index 8b21ede..099f172 100644 (file)
@@ -330,7 +330,7 @@ class ChronologyProtector implements LoggerAwareInterface {
         */
        protected function mergePositions( $curValue, array $shutdownPositions, &$cpIndex = null ) {
                /** @var DBMasterPos[] $curPositions */
-               $curPositions = isset( $curValue['positions'] ) ? $curValue['positions'] : [];
+               $curPositions = $curValue['positions'] ?? [];
                // Use the newest positions for each DB master
                foreach ( $shutdownPositions as $db => $pos ) {
                        if (
@@ -342,7 +342,7 @@ class ChronologyProtector implements LoggerAwareInterface {
                        }
                }
 
-               $cpIndex = isset( $curValue['writeIndex'] ) ? $curValue['writeIndex'] : 0;
+               $cpIndex = $curValue['writeIndex'] ?? 0;
 
                return [
                        'positions' => $curPositions,