Skip to content

Commit

Permalink
Fold if/else into ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 27, 2024
1 parent 72ec38e commit 60c14a0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/php/com/openai/realtime/RealtimeApi.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ class RealtimeApi implements Traceable {

/** @param string|util.URI|websocket.WebSocket $endpoint */
public function __construct($endpoint) {
if ($endpoint instanceof WebSocket) {
$this->ws= $endpoint;
} else {
$this->ws= new WebSocket((string)$endpoint);
}
$this->ws= $endpoint instanceof WebSocket ? $endpoint : new WebSocket((string)$endpoint);
$this->marshalling= new Marshalling();
}

Expand Down

0 comments on commit 60c14a0

Please sign in to comment.