From 57fdea8ee6980d9bd03ec105e608579885355b8e Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 5 Oct 2024 11:53:25 +0200 Subject: [PATCH] Use null-coalescing operator --- src/main/php/websocket/protocol/Opcodes.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/websocket/protocol/Opcodes.class.php b/src/main/php/websocket/protocol/Opcodes.class.php index 497fdc4..7ca9870 100755 --- a/src/main/php/websocket/protocol/Opcodes.class.php +++ b/src/main/php/websocket/protocol/Opcodes.class.php @@ -28,6 +28,6 @@ public static function nameOf($opcode) { self::PONG => 'PONG', ]; - return isset($opcodes[$opcode]) ? $opcodes[$opcode] : sprintf('UNKNOWN(0x%02x)', ord($opcode)); + return $opcodes[$opcode] ?? sprintf('UNKNOWN(0x%02x)', ord($opcode)); } } \ No newline at end of file