Skip to content

Commit d2862c0

Browse files
committed
Refactor match() to switch in JsonApiListenerTest.
1 parent 728ba22 commit d2862c0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/TestCase/Listener/JsonApiListenerTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,11 +1096,15 @@ public function testCheckRequestData()
10961096
->willReturnCallback(function () use (&$callCount): string {
10971097
$callCount++;
10981098

1099-
return match ($callCount) {
1100-
1 => 'GET',
1101-
2, 3 => 'POST',
1102-
4 => 'PATCH',
1103-
};
1099+
switch ($callCount) {
1100+
case 1:
1101+
return 'GET';
1102+
case 2:
1103+
case 3:
1104+
return 'POST';
1105+
}
1106+
1107+
return 'PATCH';
11041108
});
11051109

11061110
$controller->setRequest($request);

0 commit comments

Comments
 (0)