Merge "Recentchanges: Hide instead of disable namespace selector checkboxes"
[lhc/web/wiklou.git] / includes / widget / ExpiryInputWidget.php
index 7395df1..be6e676 100644 (file)
@@ -20,11 +20,6 @@ class ExpiryInputWidget extends Widget {
         */
        protected $relativeInput;
 
-       /**
-        * @var bool
-        */
-       protected $noDatePicker;
-
        /**
         * @var bool
         */
@@ -37,26 +32,20 @@ class ExpiryInputWidget extends Widget {
        public function __construct( Widget $relativeInput, array $options = [] ) {
                $config = \RequestContext::getMain()->getConfig();
 
-               $options['noDatePicker'] = $config->get( 'ExpiryWidgetNoDatePicker' );
-
                parent::__construct( $options );
 
-               $this->noDatePicker = $options['noDatePicker'];
-               $this->required = isset( $options['required'] ) ? $options['required'] : false;
+               $this->required = $options['required'] ?? false;
 
                // Properties
                $this->relativeInput = $relativeInput;
                $this->relativeInput->addClasses( [ 'mw-widget-ExpiryWidget-relative' ] );
 
                // Initialization
-               $classes = [
-                       'mw-widget-ExpiryWidget',
-               ];
-               if ( $options['noDatePicker'] === false ) {
-                       $classes[] = 'mw-widget-ExpiryWidget-hasDatePicker';
-               }
                $this
-                       ->addClasses( $classes )
+                       ->addClasses( [
+                               'mw-widget-ExpiryWidget',
+                               'mw-widget-ExpiryWidget-hasDatePicker'
+                       ] )
                        ->appendContent( $this->relativeInput );
        }
 
@@ -65,10 +54,9 @@ class ExpiryInputWidget extends Widget {
        }
 
        /**
-        * {@inheritdoc}
+        * @inheritDoc
         */
        public function getConfig( &$config ) {
-               $config['noDatePicker'] = $this->noDatePicker;
                $config['required'] = $this->required;
                $config['relativeInput'] = [];
                $this->relativeInput->getConfig( $config['relativeInput'] );