getProvider(); '@phan-var SessionProvider $provider'; switch ( $flag ) { case self::CHOOSE_REMEMBER: $this->skippable = true; $this->checkbox = true; $this->expiration = $provider->getRememberUserDuration(); break; case self::FORCE_CHOOSE_REMEMBER: $this->skippable = false; $this->checkbox = true; $this->expiration = $provider->getRememberUserDuration(); break; case self::ALWAYS_REMEMBER: $this->skippable = true; $this->checkbox = false; $this->expiration = $provider->getRememberUserDuration(); break; case self::NEVER_REMEMBER: $this->skippable = true; $this->checkbox = false; $this->expiration = null; break; default: throw new UnexpectedValueException( '$flag must be one of the values: \'' . implode( "', '", self::ALLOWED_FLAGS ) . '\'' ); } } /** * @inheritDoc * @stable to override */ public function getFieldInfo() { if ( !$this->expiration || !$this->checkbox ) { return []; } $expirationDays = ceil( $this->expiration / ( 3600 * 24 ) ); return [ 'rememberMe' => [ 'type' => 'checkbox', 'label' => wfMessage( 'userlogin-remembermypassword' )->numParams( $expirationDays ), 'help' => wfMessage( 'authmanager-userlogin-remembermypassword-help' ), 'optional' => true, 'skippable' => $this->skippable, ] ]; } }