11<?php
2+
23namespace LaunchDarkly \Impl \Events ;
34
45use LaunchDarkly \EvaluationDetail ;
56use LaunchDarkly \EvaluationReason ;
6- use LaunchDarkly \LDUser ;
7- use LaunchDarkly \Impl \Util ;
87use LaunchDarkly \Impl \Model \FeatureFlag ;
8+ use LaunchDarkly \Impl \Util ;
9+ use LaunchDarkly \LDUser ;
910
1011/**
1112 * @ignore
@@ -34,10 +35,10 @@ public function newEvalEvent(
3435 LDUser $ user ,
3536 EvaluationDetail $ detail ,
3637 $ default ,
37- $ prereqOfFlag = null ): array
38- {
38+ $ prereqOfFlag = null
39+ ): array {
3940 $ addExperimentData = static ::isExperiment ($ flag , $ detail ->getReason ());
40- $ e = array (
41+ $ e = [
4142 'kind ' => 'feature ' ,
4243 'creationDate ' => Util::currentTimeUnixMillis (),
4344 'key ' => $ flag ->getKey (),
@@ -46,7 +47,7 @@ public function newEvalEvent(
4647 'value ' => $ detail ->getValue (),
4748 'default ' => $ default ,
4849 'version ' => $ flag ->getVersion ()
49- ) ;
50+ ] ;
5051 // the following properties are handled separately so we don't waste bandwidth on unused keys
5152 if ($ addExperimentData || $ flag ->isTrackEvents ()) {
5253 $ e ['trackEvents ' ] = true ;
@@ -71,15 +72,15 @@ public function newEvalEvent(
7172 */
7273 public function newDefaultEvent (FeatureFlag $ flag , LDUser $ user , EvaluationDetail $ detail ): array
7374 {
74- $ e = array (
75+ $ e = [
7576 'kind ' => 'feature ' ,
7677 'creationDate ' => Util::currentTimeUnixMillis (),
7778 'key ' => $ flag ->getKey (),
7879 'user ' => $ user ,
7980 'value ' => $ detail ->getValue (),
8081 'default ' => $ detail ->getValue (),
8182 'version ' => $ flag ->getVersion ()
82- ) ;
83+ ] ;
8384 // the following properties are handled separately so we don't waste bandwidth on unused keys
8485 if ($ flag ->isTrackEvents ()) {
8586 $ e ['trackEvents ' ] = true ;
@@ -101,14 +102,14 @@ public function newDefaultEvent(FeatureFlag $flag, LDUser $user, EvaluationDetai
101102 */
102103 public function newUnknownFlagEvent (string $ key , LDUser $ user , EvaluationDetail $ detail ): array
103104 {
104- $ e = array (
105+ $ e = [
105106 'kind ' => 'feature ' ,
106107 'creationDate ' => Util::currentTimeUnixMillis (),
107108 'key ' => $ key ,
108109 'user ' => $ user ,
109110 'value ' => $ detail ->getValue (),
110111 'default ' => $ detail ->getValue ()
111- ) ;
112+ ] ;
112113 // the following properties are handled separately so we don't waste bandwidth on unused keys
113114 if ($ this ->_withReasons && $ detail ->getReason ()) {
114115 $ e ['reason ' ] = $ detail ->getReason ()->jsonSerialize ();
@@ -124,12 +125,12 @@ public function newUnknownFlagEvent(string $key, LDUser $user, EvaluationDetail
124125 */
125126 public function newIdentifyEvent (LDUser $ user ): array
126127 {
127- return array (
128+ return [
128129 'kind ' => 'identify ' ,
129130 'creationDate ' => Util::currentTimeUnixMillis (),
130131 'key ' => strval ($ user ->getKey ()),
131132 'user ' => $ user
132- ) ;
133+ ] ;
133134 }
134135
135136 /**
@@ -142,12 +143,12 @@ public function newIdentifyEvent(LDUser $user): array
142143 */
143144 public function newCustomEvent (string $ eventName , LDUser $ user , $ data , $ metricValue ): array
144145 {
145- $ e = array (
146+ $ e = [
146147 'kind ' => 'custom ' ,
147148 'creationDate ' => Util::currentTimeUnixMillis (),
148149 'key ' => $ eventName ,
149150 'user ' => $ user
150- ) ;
151+ ] ;
151152 if (isset ($ data )) {
152153 $ e ['data ' ] = $ data ;
153154 }
@@ -165,14 +166,14 @@ public function newCustomEvent(string $eventName, LDUser $user, $data, $metricVa
165166 */
166167 public function newAliasEvent (LDUser $ user , LDUser $ previousUser ): array
167168 {
168- $ e = array (
169+ $ e = [
169170 'kind ' => 'alias ' ,
170171 'key ' => strval ($ user ->getKey ()),
171172 'contextKind ' => static ::contextKind ($ user ),
172173 'previousKey ' => strval ($ previousUser ->getKey ()),
173174 'previousContextKind ' => static ::contextKind ($ previousUser ),
174175 'creationDate ' => Util::currentTimeUnixMillis ()
175- ) ;
176+ ] ;
176177
177178 return $ e ;
178179 }
0 commit comments