Simplify PHP by using ?? and ?:
[lhc/web/wiklou.git] / includes / specialpage / QueryPage.php
index f642106..96f50bf 100644 (file)
@@ -806,7 +806,7 @@ abstract class QueryPage extends SpecialPage {
                }
                $title = Title::makeTitle( intval( $row->namespace ), $row->title );
                if ( $title ) {
-                       $date = isset( $row->timestamp ) ? $row->timestamp : '';
+                       $date = $row->timestamp ?? '';
                        $comments = '';
                        if ( $title ) {
                                $talkpage = $title->getTalkPage();
@@ -830,7 +830,7 @@ abstract class QueryPage extends SpecialPage {
        }
 
        function feedItemAuthor( $row ) {
-               return isset( $row->user_text ) ? $row->user_text : '';
+               return $row->user_text ?? '';
        }
 
        function feedTitle() {
@@ -865,7 +865,7 @@ abstract class QueryPage extends SpecialPage {
 
                $batch = new LinkBatch;
                foreach ( $res as $row ) {
-                       $batch->add( $ns !== null ? $ns : $row->namespace, $row->title );
+                       $batch->add( $ns ?? $row->namespace, $row->title );
                }
                $batch->execute();