Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / includes / actions / HistoryAction.php
index 0e964bf..ad26256 100644 (file)
@@ -335,8 +335,8 @@ class HistoryAction extends FormlessAction {
         * @return FeedItem
         */
        function feedItem( $row ) {
-               $rev = new Revision( $row );
-               $rev->setTitle( $this->getTitle() );
+               $rev = new Revision( $row, 0, $this->getTitle() );
+
                $text = FeedUtils::formatDiffRow(
                        $this->getTitle(),
                        $this->getTitle()->getPreviousRevisionID( $rev->getId() ),
@@ -611,7 +611,7 @@ class HistoryPager extends ReverseChronologicalPager {
         * Creates a submit button
         *
         * @param string $message Text of the submit button, will be escaped
-        * @param array $attributes Attributes
+        * @param array $attributes
         * @return string HTML output for the submit button
         */
        function submitButton( $message, $attributes = [] ) {
@@ -639,12 +639,10 @@ class HistoryPager extends ReverseChronologicalPager {
         */
        function historyLine( $row, $next, $notificationtimestamp = false,
                $latest = false, $firstInList = false ) {
-               $rev = new Revision( $row );
-               $rev->setTitle( $this->getTitle() );
+               $rev = new Revision( $row, 0, $this->getTitle() );
 
                if ( is_object( $next ) ) {
-                       $prevRev = new Revision( $next );
-                       $prevRev->setTitle( $this->getTitle() );
+                       $prevRev = new Revision( $next, 0, $this->getTitle() );
                } else {
                        $prevRev = null;
                }
@@ -713,9 +711,7 @@ class HistoryPager extends ReverseChronologicalPager {
                # Sometimes rev_len isn't populated
                if ( $rev->getSize() !== null ) {
                        # Size is always public data
-                       $prevSize = isset( $this->parentLens[$row->rev_parent_id] )
-                               ? $this->parentLens[$row->rev_parent_id]
-                               : 0;
+                       $prevSize = $this->parentLens[$row->rev_parent_id] ?? 0;
                        $sDiff = ChangesList::showCharacterDifference( $prevSize, $rev->getSize() );
                        $fSize = Linker::formatRevisionSize( $rev->getSize() );
                        $s .= ' <span class="mw-changeslist-separator">. .</span> ' . "$fSize $sDiff";