Merge "PHP: Use short ternary operator (?:) where possible"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 11 Jun 2018 23:06:59 +0000 (23:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 11 Jun 2018 23:06:59 +0000 (23:06 +0000)
1  2 
includes/changetags/ChangeTags.php

@@@ -386,7 -386,7 +386,7 @@@ class ChangeTags 
                                                'ct_log_id' => $log_id,
                                                'ct_rev_id' => $rev_id,
                                                'ct_params' => $params,
 -                                              'ct_tag_id' => isset( $changeTagMapping[$tag] ) ? $changeTagMapping[$tag] : null,
 +                                              'ct_tag_id' => $changeTagMapping[$tag] ?? null,
                                        ]
                                );
  
                // $prevTags can be out of date on replica DBs, especially when addTags is called consecutively,
                // causing loss of tags added recently in tag_summary table.
                $prevTags = $dbw->selectField( 'tag_summary', 'ts_tags', $tsConds, __METHOD__ );
-               $prevTags = $prevTags ? $prevTags : '';
+               $prevTags = $prevTags ?: '';
                $prevTags = array_filter( explode( ',', $prevTags ) );
  
                // add tags