class EventCollection
@template-implements IteratorAggregate<int, Event>
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Event\EventCollection implements \Countable, \IteratorAggregate
Expanded class hierarchy of EventCollection
File
-
vendor/
phpunit/ phpunit/ src/ Event/ Events/ EventCollection.php, line 21
Namespace
PHPUnit\EventView source
final class EventCollection implements Countable, IteratorAggregate {
/**
* @psalm-var list<Event>
*/
private array $events = [];
public function add(Event ...$events) : void {
foreach ($events as $event) {
$this->events[] = $event;
}
}
/**
* @psalm-return list<Event>
*/
public function asArray() : array {
return $this->events;
}
public function count() : int {
return count($this->events);
}
public function isEmpty() : bool {
return $this->count() === 0;
}
public function isNotEmpty() : bool {
return $this->count() > 0;
}
public function getIterator() : EventCollectionIterator {
return new EventCollectionIterator($this);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
EventCollection::$events | private | property | @psalm-var list<Event> |
EventCollection::add | public | function | |
EventCollection::asArray | public | function | @psalm-return list<Event> |
EventCollection::count | public | function | |
EventCollection::getIterator | public | function | |
EventCollection::isEmpty | public | function | |
EventCollection::isNotEmpty | public | function |