Skip to content

Commit

Permalink
Use null-coalescing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 5, 2024
1 parent 8d2ba32 commit 57fdea8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/php/websocket/protocol/Opcodes.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 57fdea8

Please sign in to comment.