Skip to content

Commit 56ecfa2

Browse files
committed
Work Around PHPCompatibility Bug
1 parent 05847dc commit 56ecfa2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/PhpSpreadsheet/Style/NumberFormat/Wizard/CurrencyNegative.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44

55
enum CurrencyNegative
66
{
7+
// PHPCompatibility (versions check) has an error which
8+
// causes it to flag the use of $this below as erroneous.
9+
// They fixed it in their development branch in October 2022.
10+
// But they haven't had a release since 2019!
11+
// Hence the phpcs disable statment below.
712
case minus;
813
case redMinus;
914
case parentheses;
1015
case redParentheses;
1116

17+
// phpcs:disable PHPCompatibility.Variables.ForbiddenThisUseContexts
1218
public function start(): string
1319
{
1420
return match ($this) {
@@ -32,4 +38,5 @@ public function color(): string
3238
self::parentheses, self::minus => '',
3339
};
3440
}
41+
// phpcs:enable
3542
}

0 commit comments

Comments
 (0)