v0.7.0
What's new
Event API ($client->events())
get(GetQuery)— arbitrary query with full typinggetById(int)/findByTitle(string)— single-record lookupsupcoming(int $limit = 10)— active events withstart_date > now, ordered ASC; clock is injectable for deterministic testsbetween(DateTimeImmutable, DateTimeImmutable)— events within a date rangeparticipantCount(int $eventId, ?ParticipantStatus $status = null)— efficient count viaselect=['row_count']isFull(int $eventId)— compares positive-class participant count againstmax_participants; false when no cap
Participant API ($client->participants())
register(contactId, eventId, status, roleId, source, customFields)— creates aParticipantrecordmarkAttended(int)— sets status toAttendedcancel(int, ?string $reason)— sets status toCancelled; optionally creates a Follow Up activitycheckIn(int, ?DateTimeImmutable $at)— sets status toAttended; optionally creates a Check-in activity with timestampforEvent(int, ?ParticipantStatus)— all participants for an event, optional status filterforContact(int)— registration history ordered byregister_date DESCcountByStatus(int $eventId): array<string,int>— single grouped transport call returning status name → count map
ParticipantStatus enum
Backed string enum with three classification methods matching CiviCRM's class column:
| Class | Statuses | Method |
|---|---|---|
| Positive | Registered, Attended | isPositive() |
| Pending | Pending from pay later, On waitlist, Awaiting approval | isPending() |
| Negative | No-show, Cancelled, Rejected, Expired | isNegative() |
ClockInterface + SystemClock
ClockInterface::now(): DateTimeImmutable — injectable wall-clock time for deterministic tests. SystemClock is the default production implementation wired by CiviCrmClient::events().
Quality
576 tests, 99.4% line coverage, PHPStan level max clean, Rector clean, Pint (PER-CS 2.0) clean.