Skip to content

Commit

Permalink
Fix "Implicitly marking parameter $prompt as nullable is deprecated"
Browse files Browse the repository at this point in the history
Fixes #346
  • Loading branch information
thekid committed Dec 30, 2024
1 parent 1c924c0 commit dead44e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ XP Framework Core ChangeLog

## ?.?.? / ????-??-??

### Bugfixes

* Fixed *Implicitly marking parameter $prompt as nullable is deprecated*
warnings in `util.cmd.Console` class with PHP 8.4, fixing #346.
(@thekid)

### Features

* Merged PR #345: Support passing floating point numbers to constructor,
Expand Down
8 changes: 4 additions & 4 deletions src/main/php/util/cmd/Console.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ public static function writeLinef($format, ... $args) {
* Read a line from standard input. The line ending (\r and/or \n)
* is trimmed off the end.
*
* @param string $prompt Optional prompt
* @param ?string $prompt Optional prompt
* @return string
*/
public static function readLine(string $prompt= null) {
public static function readLine($prompt= null) {
$prompt && self::$out->write($prompt.' ');
return self::$in->readLine();
}

/**
* Read a single character from standard input.
*
* @param string $prompt Optional prompt
* @param ?string $prompt Optional prompt
* @return string
*/
public static function read(string $prompt= null) {
public static function read($prompt= null) {
$prompt && self::$out->write($prompt.' ');
return self::$in->read(1);
}
Expand Down

0 comments on commit dead44e

Please sign in to comment.