Skip to content

Commit 231fc74

Browse files
committed
Remove pointless Message::toJson()
1 parent 4c78061 commit 231fc74

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

example/events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function (Client $client) use ($loop) {
2525
});
2626

2727
$client->on('event', function (Event $event) {
28-
echo 'Event: ' . $event->getName() . ': ' . $event->toJson() . PHP_EOL;
28+
echo 'Event: ' . $event->getName() . ': ' . json_encode($event->getFields()) . PHP_EOL;
2929
});
3030
},
3131
function (Exception $error) {

src/Protocol/Message.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ public function getField($key)
2424
return null;
2525
}
2626

27-
public function toJson()
28-
{
29-
return json_encode($this->getFields());
30-
}
31-
3227
public function getFields()
3328
{
3429
return $this->fields;

0 commit comments

Comments
 (0)