Locker\Data\Analytics\Analytics::setType PHP Method

setType() private method

Gets and validates the type.
private setType ( String $type = '' ) : String
$type String
return String (Defaults to 'time').
    private function setType($type = '')
    {
        // Validates the type.
        if (!in_array($type, ['time', 'user', 'verb', 'activity', ''])) {
            throw new Exceptions\Exception("'{$type}' is not a valid `type`.");
        }
        return $type === '' ? 'time' : $type;
    }