Skip to content

Commit 44bf891

Browse files
committed
removed deprecated stuff
1 parent 6b05e9a commit 44bf891

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

src/CommandLine/Console.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@ public function useColors(bool $state = true): void
4646
* Returns ANSI escape sequence for given color.
4747
* Color format: 'foreground' or 'foreground/background' (e.g. 'red', 'white/blue').
4848
*/
49-
public function color(?string $color): string
49+
public function color(string $color): string
5050
{
51-
$color ??= '';
52-
if (func_num_args() > 1) {
53-
return $this->colorize(func_get_arg(1), $color); // back compatibility
54-
} elseif (!$this->useColors) {
51+
if (!$this->useColors) {
5552
return '';
5653
}
5754

src/CommandLine/Parser.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,6 @@ class Parser
2424
Normalizer = 'normalizer',
2525
Default = 'default';
2626

27-
#[\Deprecated('use Parser::Argument')]
28-
public const ARGUMENT = self::Argument;
29-
30-
#[\Deprecated('use Parser::Optional')]
31-
public const OPTIONAL = self::Optional;
32-
33-
#[\Deprecated('use Parser::Repeatable')]
34-
public const REPEATABLE = self::Repeatable;
35-
36-
#[\Deprecated('use Parser::Enum')]
37-
public const ENUM = self::Enum;
38-
39-
#[\Deprecated('use Parser::RealPath')]
40-
public const REALPATH = self::RealPath;
41-
42-
#[\Deprecated('use Parser::Default')]
43-
public const VALUE = self::Default;
4427
private const OptionPresent = true;
4528

4629
/** @var array<string, Option> */

tests/Console.color.phpt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ test('color() returns ANSI sequence', function () use ($console) {
1818
Assert::same("\e[1;31;42m", $console->color('red/lime'));
1919
});
2020

21-
test('color() back compatibility', function () use ($console) {
22-
Assert::same("\x1b[0mhello\x1b[0m", $console->color(null, 'hello'));
23-
Assert::same("\x1b[1;31mhello\x1b[0m", $console->color('red', 'hello'));
24-
Assert::same("\x1b[1;31;42mhello\x1b[0m", $console->color('red/green', 'hello'));
25-
Assert::same("\x1b[1;31;42mhello\x1b[0m", $console->color('red/lime', 'hello'));
26-
});
27-
2821
test('colorize() wraps text with color and reset', function () use ($console) {
2922
Assert::same("\e[0mhello\e[0m", $console->colorize('hello', ''));
3023
Assert::same("\e[1;31mhello\e[0m", $console->colorize('hello', 'red'));

0 commit comments

Comments
 (0)