public static function isValidUserProfileMap($userProfileMap)
    {
        if (!is_array($userProfileMap)) {
            return false;
        }

        if (!isset($userProfileMap[self::USER_ID_KEY])) {
            return false;
        }

        if (!isset($userProfileMap[self::EXPERIMENT_BUCKET_MAP_KEY])) {
            return false;
        }

        if (!is_array($userProfileMap[self::EXPERIMENT_BUCKET_MAP_KEY])) {
            return false;
        }

        // validate the experiment bucket map
        $experimentBucketMap = $userProfileMap[self::EXPERIMENT_BUCKET_MAP_KEY];
        foreach ($experimentBucketMap as $experimentId => $decision) {
            if (!is_array($decision)) {
                return false;
            }

            // make sure that there is a variation ID property in every decision
            if (!isset($decision[self::VARIATION_ID_KEY])) {
                return false;
            }
        }

        // Looks good to me
        return true;
    }
public static function isValidUserProfileMap($userProfileMap)
    {
        if (!is_array($userProfileMap)) {
            return false;
        }

        if (!isset($userProfileMap[self::USER_ID_KEY])) {
            return false;
        }

        if (!isset($userProfileMap[self::EXPERIMENT_BUCKET_MAP_KEY])) {
            return false;
        }

        if (!is_array($userProfileMap[self::EXPERIMENT_BUCKET_MAP_KEY])) {
            return false;
        }

        // validate the experiment bucket map
        $experimentBucketMap = $userProfileMap[self::EXPERIMENT_BUCKET_MAP_KEY];
        foreach ($experimentBucketMap as $experimentId => $decision) {
            if (!is_array($decision)) {
                return false;
            }

            // make sure that there is a variation ID property in every decision
            if (!isset($decision[self::VARIATION_ID_KEY])) {
                return false;
            }
        }

        // Looks good to me
        return true;
    }
public static function isValidUserProfileMap ( $ userProfileMap ) { if ( ! is_array ( $ userProfileMap ) ) { return false ; } if ( ! isset ( $ userProfileMap [ self :: USER_ID_KEY ] ) ) { return false ; } if ( ! isset ( $ userProfileMap [ self :: EXPERIMENT_BUCKET_MAP_KEY ] ) ) { return false ; } if ( ! is_array ( $ userProfileMap [ self :: EXPERIMENT_BUCKET_MAP_KEY ] ) ) { return false ; } // validate the experiment bucket map $ experimentBucketMap = $ userProfileMap [ self :: EXPERIMENT_BUCKET_MAP_KEY ] ; foreach ( $ experimentBucketMap as $ experimentId => $ decision ) { if ( ! is_array ( $ decision ) ) { return false ; } // make sure that there is a variation ID property in every decision if ( ! isset ( $ decision [ self :: VARIATION_ID_KEY ] ) ) { return false ; } } // Looks good to me return true ; }
Grab the revenue value from the event tags. "revenue" is a reserved keyword.

@param  $userProfileMap array Representing the user profile.
@return true if the given user profile map is valid, false otherwise.
Grab the revenue value from the event tags . revenue is a reserved keyword .