class ConstantCollection
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
@psalm-immutable
@template-implements IteratorAggregate<int, Constant>
Hierarchy
- class \PHPUnit\TextUI\Configuration\ConstantCollection implements \Countable, \IteratorAggregate
Expanded class hierarchy of ConstantCollection
2 files declare their use of ConstantCollection
- DefaultConfiguration.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ DefaultConfiguration.php - Loader.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ Loader.php
File
-
vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Value/ ConstantCollection.php, line 23
Namespace
PHPUnit\TextUI\ConfigurationView source
final class ConstantCollection implements Countable, IteratorAggregate {
/**
* @psalm-var list<Constant>
*/
private readonly array $constants;
/**
* @psalm-param list<Constant> $constants
*/
public static function fromArray(array $constants) : self {
return new self(...$constants);
}
private function __construct(Constant ...$constants) {
$this->constants = $constants;
}
/**
* @psalm-return list<Constant>
*/
public function asArray() : array {
return $this->constants;
}
public function count() : int {
return count($this->constants);
}
public function getIterator() : ConstantCollectionIterator {
return new ConstantCollectionIterator($this);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ConstantCollection::$constants | private | property | @psalm-var list<Constant> |
ConstantCollection::asArray | public | function | @psalm-return list<Constant> |
ConstantCollection::count | public | function | |
ConstantCollection::fromArray | public static | function | @psalm-param list<Constant> $constants |
ConstantCollection::getIterator | public | function | |
ConstantCollection::__construct | private | function |