PostHog / posthog-php

MIT License
18 stars 19 forks source link

fix(flags): Safe access flags in decide v2 #55

Closed neilkakkar closed 1 year ago

neilkakkar commented 1 year ago

Since decide v2 doesn't return all flags, but just true flags, this leads to an error when you're checking for a false flag:

Unable to get feature variants:Undefined array key "flag-key"

This PR defends against this.

neilkakkar commented 1 year ago

looking again, it seems like there was a test for this already, it just wasn't failing because it goes to the error log, instead of raising an exception 👀 - fixing