From 2a1fe965a16c1edcc173ec859aac5444181e2076 Mon Sep 17 00:00:00 2001 From: binaryk Date: Wed, 13 Apr 2022 11:56:29 +0000 Subject: [PATCH] Fix styling --- src/Dto/SegmentPayload.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Dto/SegmentPayload.php b/src/Dto/SegmentPayload.php index 091ecdf..7d294bf 100644 --- a/src/Dto/SegmentPayload.php +++ b/src/Dto/SegmentPayload.php @@ -24,10 +24,11 @@ class SegmentPayload extends DataTransferObject public function toSegment(): array { - return array_merge([ + return array_merge( + [ 'event' => $this->name, 'properties' => $this->properties, - 'anonymousId' => $this->actor ?? Str::uuid()->__toString() + 'anonymousId' => $this->actor ?? Str::uuid()->__toString(), ], ($this->actor ? ['userId' => $this->actor] : []), ($this->messageId ? ['messageId' => $this->messageId] : []), @@ -68,7 +69,7 @@ public function messageId(?string $messageId): self return $this; } - + public function track(): bool { return $this->sent = Segment::track($this->toSegment());