Merge "Warn if stateful ParserOutput transforms are used"
[lhc/web/wiklou.git] / includes / changes / ChangesListFilter.php
index bd895bb..d191453 100644 (file)
@@ -18,7 +18,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GPL 2+
  * @author Matthew Flaschen
  */
 
@@ -103,6 +102,12 @@ abstract class ChangesListFilter {
         */
        protected $priority;
 
+       /**
+        *
+        * @var string $defaultHighlightColor
+        */
+       protected $defaultHighlightColor;
+
        const RESERVED_NAME_CHAR = '_';
 
        /**
@@ -178,20 +183,15 @@ abstract class ChangesListFilter {
         * (not filtered out), even for the hide-based filters.  So e.g. conflicting with
         * 'hideanons' means there is a conflict if only anonymous users are *shown*.
         *
-        * @param ChangesListFilterGroup|ChangesListFilter $other Other
-        *  ChangesListFilterGroup or ChangesListFilter
+        * @param ChangesListFilterGroup|ChangesListFilter $other
         * @param string $globalKey i18n key for top-level conflict message
         * @param string $forwardKey i18n key for conflict message in this
         *  direction (when in UI context of $this object)
         * @param string $backwardKey i18n key for conflict message in reverse
         *  direction (when in UI context of $other object)
         */
-       public function conflictsWith( $other, $globalKey, $forwardKey,
-               $backwardKey ) {
-
-               if ( $globalKey === null || $forwardKey === null ||
-                       $backwardKey === null ) {
-
+       public function conflictsWith( $other, $globalKey, $forwardKey, $backwardKey ) {
+               if ( $globalKey === null || $forwardKey === null || $backwardKey === null ) {
                        throw new MWException( 'All messages must be specified' );
                }
 
@@ -214,15 +214,12 @@ abstract class ChangesListFilter {
         *
         * Internal use ONLY.
         *
-        * @param ChangesListFilterGroup|ChangesListFilter $other Other
-        *  ChangesListFilterGroup or ChangesListFilter
+        * @param ChangesListFilterGroup|ChangesListFilter $other
         * @param string $globalDescription i18n key for top-level conflict message
         * @param string $contextDescription i18n key for conflict message in this
         *  direction (when in UI context of $this object)
         */
-       public function setUnidirectionalConflict( $other, $globalDescription,
-               $contextDescription ) {
-
+       public function setUnidirectionalConflict( $other, $globalDescription, $contextDescription ) {
                if ( $other instanceof ChangesListFilterGroup ) {
                        $this->conflictingGroups[] = [
                                'group' => $other->getName(),
@@ -315,6 +312,7 @@ abstract class ChangesListFilter {
         * structured UI.
         *
         * This can either be the exact filter, or a new filter that replaces it.
+        * @return bool
         */
        public function isFeatureAvailableOnStructuredUi() {
                return $this->displaysOnStructuredUi();
@@ -373,6 +371,7 @@ abstract class ChangesListFilter {
                        'priority' => $this->priority,
                        'subset' => $this->subsetFilters,
                        'conflicts' => [],
+                       'defaultHighlightColor' => $this->defaultHighlightColor
                ];
 
                $output['messageKeys'] = [
@@ -466,7 +465,7 @@ abstract class ChangesListFilter {
         * @param FormOptions $opts
         * @return bool
         */
-       public function activelyInConflictWithFilter( ChangeslistFilter $filter, FormOptions $opts ) {
+       public function activelyInConflictWithFilter( ChangesListFilter $filter, FormOptions $opts ) {
                if ( $this->isSelected( $opts ) && $filter->isSelected( $opts ) ) {
                        /** @var ChangesListFilter $siblingFilter */
                        foreach ( $this->getSiblings() as $siblingFilter ) {
@@ -482,7 +481,7 @@ abstract class ChangesListFilter {
                return false;
        }
 
-       private function hasConflictWithFilter( ChangeslistFilter $filter ) {
+       private function hasConflictWithFilter( ChangesListFilter $filter ) {
                return in_array( $filter, $this->getConflictingFilters() );
        }
 
@@ -499,4 +498,11 @@ abstract class ChangesListFilter {
                        }
                );
        }
+
+       /**
+        * @param string $defaultHighlightColor
+        */
+       public function setDefaultHighlightColor( $defaultHighlightColor ) {
+               $this->defaultHighlightColor = $defaultHighlightColor;
+       }
 }