Skip to content

Commit

Permalink
Handle impression data
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonfournier committed Sep 25, 2024
1 parent 14741d9 commit c9568bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Repository/DefaultUnleashProxyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ private function validateResponse(array $response): ?array
return null;
}

if (!is_string($response['name']) || !is_bool($response['enabled']) || !is_bool($response['impressionData']) || !is_array($response['variant'])) {
$impressionData = $response['impressionData'] ?? $response['impression_data'] ?? false;
if (!is_string($response['name']) || !is_bool($response['enabled']) || !is_bool($impressionData) || !is_array($response['variant'])) {
return null;
}

Expand Down

0 comments on commit c9568bc

Please sign in to comment.