class GroupCollection
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@psalm-immutable
@template-implements IteratorAggregate<int, Group>
Hierarchy
- class \PHPUnit\TextUI\Configuration\GroupCollection implements \IteratorAggregate
Expanded class hierarchy of GroupCollection
3 files declare their use of GroupCollection
- DefaultConfiguration.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ DefaultConfiguration.php - Groups.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ Groups.php - Loader.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ Loader.php
File
-
vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Value/ GroupCollection.php, line 21
Namespace
PHPUnit\TextUI\ConfigurationView source
final class GroupCollection implements IteratorAggregate {
/**
* @psalm-var list<Group>
*/
private readonly array $groups;
/**
* @psalm-param list<Group> $groups
*/
public static function fromArray(array $groups) : self {
return new self(...$groups);
}
private function __construct(Group ...$groups) {
$this->groups = $groups;
}
/**
* @psalm-return list<Group>
*/
public function asArray() : array {
return $this->groups;
}
/**
* @psalm-return list<string>
*/
public function asArrayOfStrings() : array {
$result = [];
foreach ($this->groups as $group) {
$result[] = $group->name();
}
return $result;
}
public function isEmpty() : bool {
return empty($this->groups);
}
public function getIterator() : GroupCollectionIterator {
return new GroupCollectionIterator($this);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
GroupCollection::$groups | private | property | @psalm-var list<Group> |
GroupCollection::asArray | public | function | @psalm-return list<Group> |
GroupCollection::asArrayOfStrings | public | function | @psalm-return list<string> |
GroupCollection::fromArray | public static | function | @psalm-param list<Group> $groups |
GroupCollection::getIterator | public | function | |
GroupCollection::isEmpty | public | function | |
GroupCollection::__construct | private | function |