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

Breadcrumb

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

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\Extension
View 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&lt;string, string&gt; $parameters
ParameterCollection::get public function
ParameterCollection::has public function
ParameterCollection::__construct private function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal