Use PHP 7 '??' operator instead of if-then-else
[lhc/web/wiklou.git] / includes / api / ApiRollback.php
index d2ff790..c9ff260 100644 (file)
@@ -69,10 +69,7 @@ class ApiRollback extends ApiBase {
                        $this->dieStatus( $this->errorArrayToStatus( $retval, $user ) );
                }
 
-               $watch = 'preferences';
-               if ( isset( $params['watchlist'] ) ) {
-                       $watch = $params['watchlist'];
-               }
+               $watch = $params['watchlist'] ?? 'preferences';
 
                // Watch pages
                $this->setWatch( $watch, $titleObj, 'watchrollback' );