MDL-41060 events: Replace array_key_exists with isset()