11use UnexpectedValueException;
73 private $checkbox =
false;
88 public function __construct(
string $flag = self::CHOOSE_REMEMBER ) {
90 $provider = RequestContext::getMain()->getRequest()->getSession()->getProvider();
91 '@phan-var SessionProvider $provider';
95 $this->skippable =
true;
96 $this->checkbox =
true;
97 $this->expiration = $provider->getRememberUserDuration();
100 $this->skippable =
false;
101 $this->checkbox =
true;
102 $this->expiration = $provider->getRememberUserDuration();
105 $this->skippable =
true;
106 $this->checkbox =
false;
107 $this->expiration = $provider->getRememberUserDuration();
110 $this->skippable =
true;
111 $this->checkbox =
false;
112 $this->expiration =
null;
115 throw new UnexpectedValueException(
'$flag must be one of the values: \'' .
116 implode(
"', '", self::ALLOWED_FLAGS ) .
'\'' );
125 if ( !$this->expiration || !$this->checkbox ) {
129 $expirationDays = ceil( $this->expiration / ( 3600 * 24 ) );
132 'type' =>
'checkbox',
133 'label' =>
wfMessage(
'userlogin-remembermypassword' )->numParams( $expirationDays ),
134 'help' =>
wfMessage(
'authmanager-userlogin-remembermypassword-help' ),
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Group all the pieces relevant to the context of a request into one instance.