class ParameterCollection
@psalm-immutable
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Runner\Extension\ParameterCollection
Expanded class hierarchy of ParameterCollection
File
-
vendor/
phpunit/ phpunit/ src/ Runner/ Extension/ ParameterCollection.php, line 20
Namespace
PHPUnit\Runner\ExtensionView source
final class ParameterCollection {
private readonly array $parameters;
/**
* @psalm-param array<string, string> $parameters
*/
public static function fromArray(array $parameters) : self {
return new self($parameters);
}
private function __construct(array $parameters) {
$this->parameters = $parameters;
}
public function has(string $name) : bool {
return array_key_exists($name, $this->parameters);
}
/**
* @throws ParameterDoesNotExistException
*/
public function get(string $name) : string {
if (!$this->has($name)) {
throw new ParameterDoesNotExistException($name);
}
return $this->parameters[$name];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ParameterCollection::$parameters | private | property | |
ParameterCollection::fromArray | public static | function | @psalm-param array<string, string> $parameters |
ParameterCollection::get | public | function | |
ParameterCollection::has | public | function | |
ParameterCollection::__construct | private | function |