Skip to content

Commit 8f6060d

Browse files
update
1 parent 81ebe76 commit 8f6060d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/StatsigMetadata.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ abstract class StatsigMetadata
77
public const VERSION = "3.6.0";
88
public const SDK_TYPE = "php-server";
99

10-
public static function getJson($session_id): array
10+
public static function getJson(): array
11+
{
12+
return [
13+
'sdkType' => self::SDK_TYPE,
14+
'sdkVersion' => self::VERSION,
15+
'languageVersion' => phpversion(),
16+
];
17+
}
18+
19+
public static function getJsonWithSessionID($session_id): array
1120
{
1221
return [
1322
'sdkType' => self::SDK_TYPE,

src/StatsigNetwork.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function logEventsWithStatusCode($events)
8686
{
8787
$req_body = [
8888
'events' => $events,
89-
'statsigMetadata' => StatsigMetadata::getJson($this->session_id)
89+
'statsigMetadata' => StatsigMetadata::getJsonWithSessionID($this->session_id)
9090
];
9191
$res = $this->postRequest("rgstr", json_encode($req_body), ['STATSIG-EVENT-COUNT' => strval(count($events))], true);
9292

0 commit comments

Comments
 (0)