File tree Expand file tree Collapse file tree 4 files changed +5
-42
lines changed
Expand file tree Collapse file tree 4 files changed +5
-42
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,16 +10,17 @@ public function __construct(
1010 public ?string $ userId = null ,
1111 public ?string $ event = null ,
1212 public ?array $ properties = [],
13+ public ?array $ additionalFields = [],
1314 public ?array $ context = [],
1415 ) {}
1516
1617 public function toArray (): array
1718 {
18- return [
19+ return collect ( [
1920 'userId ' => $ this ->userId ,
2021 'event ' => $ this ->event ,
2122 'properties ' => $ this ->properties ,
2223 'context ' => $ this ->context ,
23- ];
24+ ])-> merge ( $ this -> additionalFields )-> toArray () ;
2425 }
2526}
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ public function __construct(
1313 public ?array $ traits = [],
1414 ) {}
1515
16- public function toArray ()
16+ public function toArray () : array
1717 {
1818 $ baseData = collect ([
1919 'userId ' => $ this ->userId ,
2020 'anonymousId ' => $ this ->anonymousId ,
2121 'traits ' => $ this ->traits ,
2222 ]);
23- return $ baseData ->merge ($ this ->additionalFields );
23+ return $ baseData ->merge ($ this ->additionalFields )-> toArray () ;
2424 }
2525}
You can’t perform that action at this time.
0 commit comments