Text UI
A simple and fast way to take user input and display output in text mode using PHP.
Loading...
Searching...
No Matches
PasswordEntry Class Reference
Inheritance diagram for PasswordEntry:
EntryInterface

Public Member Functions

 __construct (string $label)
 
 read ()
 
- Public Member Functions inherited from EntryInterface

Protected Attributes

readonly string $label
 

Detailed Description

User password input.

Displays a message to the user and returns the text the user entered. When the user presses ENTER, the raw text entered is fed to the trim() function and returned.

The label is displayed on the same line as the entry point. This means that if you want to display the label above the input space, add a line break at the end of $label. The same goes for whitespace and tabs.

Author
everton3x @SuppressWarnings(PHPMD.StaticAccess)

Definition at line 19 of file PasswordEntry.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string $label)

Definition at line 23 of file PasswordEntry.php.

Member Function Documentation

◆ read()

read ( )

Displays the label and waits for user input.

Returns
string Returns the text entered by the user as processed by trim().

Implements EntryInterface.

Definition at line 33 of file PasswordEntry.php.

Field Documentation

◆ $label

readonly string $label
protected

Definition at line 21 of file PasswordEntry.php.


The documentation for this class was generated from the following file: