Skip to content

Commit 56072ed

Browse files
committed
fix: incompatible value type assigned to Console::$ForegroundColor in HelpBuilder and HelpResult
1 parent 718ce54 commit 56072ed

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/Command/Help/HelpBuilder.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
namespace DevNet\System\Command\Help;
1010

1111
use DevNet\System\Command\CommandLine;
12+
use DevNet\System\IO\ConsoleColor;
1213

1314
class HelpBuilder
1415
{
1516
private CommandLine $command;
16-
private int $primaryColor = 0;
17-
private int $secondaryColor = 0;
17+
private ?ConsoleColor $primaryColor = null;
18+
private ?ConsoleColor $secondaryColor = null;
1819
private array $layouts = [];
1920
private int $maxWidth = 0;
2021
private string $indent = ' ';
@@ -24,7 +25,7 @@ public function __construct(CommandLine $command)
2425
$this->command = $command;
2526
}
2627

27-
public function setColor(int $primaryColor, int $secondaryColor): void
28+
public function setColor(ConsoleColor $primaryColor, ?ConsoleColor $secondaryColor = null): void
2829
{
2930
$this->primaryColor = $primaryColor;
3031
$this->secondaryColor = $secondaryColor;

lib/Command/Help/HelpResult.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
namespace DevNet\System\Command\Help;
1010

1111
use DevNet\System\IO\Console;
12+
use DevNet\System\IO\ConsoleColor;
1213

1314
class HelpResult
1415
{
1516
private array $layouts = [];
16-
private int $primaryColor = 0;
17-
private int $secondaryColor = 0;
17+
private ?ConsoleColor $primaryColor = null;
18+
private ?ConsoleColor $secondaryColor = null;
1819
private int $maxWidth = 0;
1920

20-
public function __construct(array $layouts, int $maxWidth, int $primaryColor = 0, int $secondaryColor = 0)
21+
public function __construct(array $layouts, int $maxWidth, ?ConsoleColor $primaryColor = null, ?ConsoleColor $secondaryColor = null)
2122
{
2223
$this->layouts = $layouts;
2324
$this->maxWidth = $maxWidth;

0 commit comments

Comments
 (0)