Terminal: use match instead of switch in toANSI()

phpstan seems to have some trouble with large match statements (phpstan/phpstan#5454)
This commit is contained in:
Dylan K. Taylor
2021-08-12 20:13:44 +01:00
parent 2782af7e22
commit 6a2a4cca4d
2 changed files with 90 additions and 73 deletions

View File

@ -40,6 +40,71 @@ parameters:
count: 1
path: ../../../src/utils/Promise.php
-
message: "#^Match arm comparison between string and '§3' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§4' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§5' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§6' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§7' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§8' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§9' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§a' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§b' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§c' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§d' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§e' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Match arm comparison between string and '§f' is always false\\.$#"
count: 1
path: ../../../src/utils/Terminal.php
-
message: "#^Parameter \\#1 \\$ of closure expects TMemberType, TMemberType given\\.$#"
count: 1