@@ -49,7 +49,7 @@ public function identify(?array $identifyData = []): void
4949 /**
5050 * @param array<string, mixed> $eventData
5151 */
52- public function track (string $ event , array $ eventData = null ): void
52+ public function track (string $ event , ? array $ eventData = null ): void
5353 {
5454 $ this ->events [] = new SimpleSegmentEvent ($ this ->user , $ event , $ eventData );
5555 }
@@ -76,7 +76,7 @@ public function terminate(): void
7676 {
7777 }
7878
79- public function assertIdentified (Closure |int $ callback = null ): void
79+ public function assertIdentified (Closure |int | null $ callback = null ): void
8080 {
8181 if (is_numeric ($ callback )) {
8282 $ this ->assertIdentifiedTimes ($ callback );
@@ -100,7 +100,7 @@ public function assertIdentifiedTimes(int $times = 1): void
100100 );
101101 }
102102
103- public function assertNotIdentified (Closure $ callback = null ): void
103+ public function assertNotIdentified (? Closure $ callback = null ): void
104104 {
105105 PHPUnit::assertCount (
106106 0 , $ this ->identities ($ callback ),
@@ -115,7 +115,7 @@ public function assertNothingIdentified(): void
115115 PHPUnit::assertEmpty ($ identities , $ identities ->count ().' events were found unexpectedly. ' );
116116 }
117117
118- public function assertTracked (Closure |int $ callback = null ): void
118+ public function assertTracked (Closure |int | null $ callback = null ): void
119119 {
120120 if (is_numeric ($ callback )) {
121121 $ this ->assertTrackedTimes ($ callback );
@@ -139,23 +139,23 @@ public function assertTrackedTimes(int $times = 1): void
139139 );
140140 }
141141
142- public function assertEventTracked (string $ event , Closure |int $ callback = null ): void
142+ public function assertEventTracked (string $ event , Closure |int | null $ callback = null ): void
143143 {
144144 PHPUnit::assertTrue (
145145 $ this ->events ($ callback , $ event )->count () > 0 ,
146146 'The expected events were not called. '
147147 );
148148 }
149149
150- public function assertNotTracked (Closure $ callback = null ): void
150+ public function assertNotTracked (? Closure $ callback = null ): void
151151 {
152152 PHPUnit::assertCount (
153153 0 , $ this ->events ($ callback ),
154154 'The unexpected event was called. '
155155 );
156156 }
157157
158- public function assertEventNotTracked (string $ event , Closure |int $ callback = null ): void
158+ public function assertEventNotTracked (string $ event , Closure |int | null $ callback = null ): void
159159 {
160160 PHPUnit::assertCount (
161161 0 , $ this ->events ($ callback , $ event ),
@@ -178,7 +178,7 @@ public function getContext(): ?array
178178 return $ this ->context ;
179179 }
180180
181- private function identities (Closure $ callback = null ): Collection
181+ private function identities (? Closure $ callback = null ): Collection
182182 {
183183 $ identities = collect ($ this ->identities );
184184
@@ -191,7 +191,7 @@ private function identities(Closure $callback = null): Collection
191191 return $ identities ->filter (fn (SimpleSegmentIdentify $ identity ) => $ callback ($ identity ));
192192 }
193193
194- private function events (Closure $ callback = null , string $ event = null ): Collection
194+ private function events (? Closure $ callback = null , ? string $ event = null ): Collection
195195 {
196196 $ events = collect ($ this ->events );
197197
0 commit comments