public function toString(): string
{ return sprintf('%shas %s "%d" emails',
$this->transport ?
$this->transport.' ' : '',
$this->queued ? 'queued' : 'sent',
$this->expectedValue
);
} /**
* @param NotificationEvents $events
*/
protected function matches($events): bool
{ return $this->expectedValue ===
$this->
countNotifications($events);
} /**
* @param NotificationEvents $events
*/
protected function failureDescription($events): string
{ return sprintf('the Transport %s (%d %s)',
$this->
toString(),
$this->
countNotifications($events),
$this->queued ? 'queued' : 'sent'
);
} private function countNotifications(NotificationEvents
$events): int
{