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; }