Skip to content

Commit

Permalink
Import Arrayable.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 19, 2020
1 parent c60f905 commit 1e4f87c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Katsana\Prefetch;

use Illuminate\Contracts\Support\Arrayable;

class Data implements Contracts\Command
{
/**
Expand Down Expand Up @@ -56,8 +58,8 @@ public function __toString()

$payload = $this->message instanceof Arrayable
? $this->message->toArray()
: \json_encode($this->message);
: $this->message;

return sprintf("%sdata: %s\n\n", $id, $payload);
return sprintf("%sdata: %s\n\n", $id, \json_encode($payload));
}
}

0 comments on commit 1e4f87c

Please sign in to comment.