26use UnexpectedValueException;
86 private $checkbox =
false;
101 public function __construct(
string $flag = self::CHOOSE_REMEMBER ) {
103 $provider = SessionManager::getGlobalSession()->getProvider();
104 '@phan-var SessionProvider $provider';
108 $this->skippable =
true;
109 $this->checkbox =
true;
110 $this->expiration = $provider->getRememberUserDuration();
113 $this->skippable =
false;
114 $this->checkbox =
true;
115 $this->expiration = $provider->getRememberUserDuration();
118 $this->skippable =
true;
119 $this->checkbox =
false;
120 $this->expiration = $provider->getRememberUserDuration();
123 $this->skippable =
true;
124 $this->checkbox =
false;
125 $this->expiration =
null;
128 throw new UnexpectedValueException(
'$flag must be one of the values: \'' .
129 implode(
"', '", self::ALLOWED_FLAGS ) .
'\'' );
138 if ( !$this->expiration || !$this->checkbox ) {
142 $expirationDays = ceil( $this->expiration / ( 3600 * 24 ) );
145 'type' =>
'checkbox',
146 'label' =>
wfMessage(
'userlogin-remembermypassword' )->numParams( $expirationDays ),
147 'help' =>
wfMessage(
'authmanager-userlogin-remembermypassword-help' ),
wfMessage( $key,... $params)
This is the function for getting translated interface messages.