Merge "Delete always true condition"
[lhc/web/wiklou.git] / includes / api / ApiQueryRevisionsBase.php
index c9f528c..3d0a0fb 100644 (file)
@@ -169,11 +169,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
                                        $this->limit = 1;
                                }
                        }
-                       if ( isset( $params['section'] ) ) {
-                               $this->section = $params['section'];
-                       } else {
-                               $this->section = false;
-                       }
+                       $this->section = $params['section'] ?? false;
                }
 
                $userMax = $this->parseContent ? 1 : ( $smallLimit ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 );
@@ -620,10 +616,7 @@ abstract class ApiQueryRevisionsBase extends ApiQueryGeneratorBase {
        }
 
        public function getAllowedParams() {
-               $slotRoles = MediaWikiServices::getInstance()->getSlotRoleStore()->getMap();
-               if ( !in_array( SlotRecord::MAIN, $slotRoles, true ) ) {
-                       $slotRoles[] = SlotRecord::MAIN;
-               }
+               $slotRoles = MediaWikiServices::getInstance()->getSlotRoleRegistry()->getKnownRoles();
                sort( $slotRoles, SORT_STRING );
 
                return [