Skip to content

Commit af086f9

Browse files
committed
docs: about hidden prompt
1 parent 74560a0 commit af086f9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ $interactor->greenBold("Anything is: $any", true);
317317
```php
318318
$nameValidator = function ($value) {
319319
if (\strlen($value) < 5) {
320-
throw new \Exception('Name should be atleast 5 chars');
320+
throw new \InvalidArgumentException('Name should be atleast 5 chars');
321321
}
322322

323323
return $value;
@@ -328,6 +328,22 @@ $name = $interactor->prompt('Name', null, $nameValidator, 5);
328328
$interactor->greenBold("The name is: $name", true);
329329
```
330330

331+
#### Prompt hidden
332+
333+
> Currently not supported in windows platform, but maybe supported in future.
334+
335+
```php
336+
$passValidator = function ($pass) {
337+
if (\strlen($pass) < 6) {
338+
throw new \InvalidArgumentException('Password too short');
339+
}
340+
341+
return $pass;
342+
};
343+
344+
$pass = $interactor->promptHidden('Password', $passValidator, 2);
345+
```
346+
331347
![Interactive Preview](https://i.imgur.com/qYBNd29.gif "Interactive Preview")
332348

333349
## IO Components

0 commit comments

Comments
 (0)