Phone
in package
Class for changing and verifying a phone number
Table of Contents
Properties
- $returnedVerificationCode : string
- $settings : array<string|int, mixed>
- $userid : int
Methods
- __construct() : mixed
- Initialize the phone number change
- changePhone() : void
- Change the phone number. After running this command, you can get the verification code via the command getVerificationCode().
- getVerificationCode() : string
- Returns the phone number verification code
- resendVerificationCode() : void
- Get a new Verification code. After running this command, you can get the verification code via the command getVerificationCode().
- setUserId() : void
- Set the userid
- verify() : bool
- Verifies a phone number with a verification code
Properties
$returnedVerificationCode
private
string
$returnedVerificationCode
$settings
private
array<string|int, mixed>
$settings
$userid
private
int
$userid
Methods
__construct()
Initialize the phone number change
public
__construct(mixed $settings) : mixed
Parameters
- $settings : mixed
-
array The settings array
changePhone()
Change the phone number. After running this command, you can get the verification code via the command getVerificationCode().
public
changePhone(mixed $phone) : void
Parameters
- $phone : mixed
-
string Phone number
Tags
getVerificationCode()
Returns the phone number verification code
public
getVerificationCode() : string
Return values
string —Verification code
resendVerificationCode()
Get a new Verification code. After running this command, you can get the verification code via the command getVerificationCode().
public
resendVerificationCode() : void
setUserId()
Set the userid
public
setUserId(mixed $userid) : void
Parameters
- $userid : mixed
-
int User id
verify()
Verifies a phone number with a verification code
public
verify(mixed $verifyCode) : bool
Parameters
- $verifyCode : mixed
-
string Verification Code
Return values
bool —Is the verification code correct?