Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EventCollection.php

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\Event
View 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&lt;Event&gt;
EventCollection::add public function
EventCollection::asArray public function @psalm-return list&lt;Event&gt;
EventCollection::count public function
EventCollection::getIterator public function
EventCollection::isEmpty public function
EventCollection::isNotEmpty public function
RSS feed
Powered by Drupal